[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-120) Exception in ZIP Export leads to Deadlock

Andrew Lee Rubinger (JIRA) jira-events at lists.jboss.org
Wed Jan 20 18:15:47 EST 2010


    [ https://jira.jboss.org/jira/browse/SHRINKWRAP-120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12507369#action_12507369 ] 

Andrew Lee Rubinger commented on SHRINKWRAP-120:
------------------------------------------------

The issue here is present if there aren't entries in the ZIP file, we can't close the zipOutputStream, and the reader will hence stay open and waiting for new data (blocking)

We're not given a finely-typed exception to handle this, so instead we must have preconditions which *ensure* that at least one entry is written: SHRINKWRAP-93

> Exception in ZIP Export leads to Deadlock
> -----------------------------------------
>
>                 Key: SHRINKWRAP-120
>                 URL: https://jira.jboss.org/jira/browse/SHRINKWRAP-120
>             Project: ShrinkWrap
>          Issue Type: Bug
>          Components: impl-base
>            Reporter: Andrew Lee Rubinger
>            Assignee: Andrew Lee Rubinger
>            Priority: Blocker
>             Fix For: 1.0.0-alpha-4
>
>         Attachments: SHRINKWRAP-120.patch
>
>
> Now that ZIP export occurs in its own Thread, I'm seeing that where I introduced an Exception, we lead to deadlock.  Create a test for this and ensure the case is removed.
> Jan 20, 2010 5:55:22 PM org.jboss.shrinkwrap.impl.base.exporter.ZipExportDelegate$1 call
> WARNING: Got exception on closing the ZIP out stream: ZIP file must have at least one entry
> 2010-01-20 17:56:48
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (14.0-b16 mixed mode):
> "ReaderThread" prio=10 tid=0x00007f71680bf800 nid=0x3c4c runnable [0x00007f716cbb1000]
>    java.lang.Thread.State: RUNNABLE
> 	at java.net.SocketInputStream.socketRead0(Native Method)
> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
> 	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
> 	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
> 	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
> 	- locked <0x00007f714be2a138> (a java.io.InputStreamReader)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	- locked <0x00007f714be2a138> (a java.io.InputStreamReader)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner$ReaderThread.run(RemoteTestRunner.java:140)
> "Low Memory Detector" daemon prio=10 tid=0x00007f716809d000 nid=0x3c4a runnable [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "CompilerThread1" daemon prio=10 tid=0x00007f716809a000 nid=0x3c49 waiting on condition [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "CompilerThread0" daemon prio=10 tid=0x00007f7168098000 nid=0x3c47 waiting on condition [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "JDWP Command Reader" daemon prio=10 tid=0x00007f7104001000 nid=0x3c45 runnable [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "JDWP Event Helper Thread" daemon prio=10 tid=0x00007f7168095800 nid=0x3c43 runnable [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "JDWP Transport Listener: dt_socket" daemon prio=10 tid=0x00007f7168092000 nid=0x3c41 runnable [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "Signal Dispatcher" daemon prio=10 tid=0x00007f7168085800 nid=0x3c3f waiting on condition [0x0000000000000000]
>    java.lang.Thread.State: RUNNABLE
> "Finalizer" daemon prio=10 tid=0x00007f7168069800 nid=0x3c3e in Object.wait() [0x00007f716d936000]
>    java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x00007f714bd211e0> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
> 	- locked <0x00007f714bd211e0> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
> 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
> "Reference Handler" daemon prio=10 tid=0x00007f7168067800 nid=0x3c3d in Object.wait() [0x00007f716da37000]
>    java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x00007f714bd21048> (a java.lang.ref.Reference$Lock)
> 	at java.lang.Object.wait(Object.java:485)
> 	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
> 	- locked <0x00007f714bd21048> (a java.lang.ref.Reference$Lock)
> "main" prio=10 tid=0x00007f7168009000 nid=0x3c39 in Object.wait() [0x00007f716eb9c000]
>    java.lang.Thread.State: TIMED_WAITING (on object monitor)
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x00007f714c3774e8> (a org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream)
> 	at java.io.PipedInputStream.read(PipedInputStream.java:310)
> 	- locked <0x00007f714c3774e8> (a org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream)
> 	at org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream.read(IsReadReportingInputStream.java:68)
> 	- locked <0x00007f714c3774e8> (a org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream)
> 	at java.io.PipedInputStream.read(PipedInputStream.java:361)
> 	- locked <0x00007f714c3774e8> (a org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream)
> 	at org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream.read(IsReadReportingInputStream.java:80)
> 	- locked <0x00007f714c3774e8> (a org.jboss.shrinkwrap.impl.base.exporter.IsReadReportingInputStream)
> 	at java.io.InputStream.read(InputStream.java:85)
> 	at org.jboss.shrinkwrap.impl.base.io.IOUtil.copy(IOUtil.java:141)
> 	at org.jboss.shrinkwrap.impl.base.io.IOUtil.copyWithClose(IOUtil.java:161)
> 	at org.jboss.shrinkwrap.impl.base.importer.ZipImporterImplTestCase.shouldBeAbleToImportAddAndExport(ZipImporterImplTestCase.java:118)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
> 	at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> "VM Thread" prio=10 tid=0x00007f7168060800 nid=0x3c3c runnable 
> "GC task thread#0 (ParallelGC)" prio=10 tid=0x00007f7168013000 nid=0x3c3a runnable 
> "GC task thread#1 (ParallelGC)" prio=10 tid=0x00007f7168014800 nid=0x3c3b runnable 
> "VM Periodic Task Thread" prio=10 tid=0x00007f716809f800 nid=0x3c4b waiting on condition 
> JNI global references: 1649
> Heap
>  PSYoungGen      total 18048K, used 7146K [0x00007f714bd20000, 0x00007f714d140000, 0x00007f715ff20000)
>   eden space 15488K, 46% used [0x00007f714bd20000,0x00007f714c41ab38,0x00007f714cc40000)
>   from space 2560K, 0% used [0x00007f714cec0000,0x00007f714cec0000,0x00007f714d140000)
>   to   space 2560K, 0% used [0x00007f714cc40000,0x00007f714cc40000,0x00007f714cec0000)
>  PSOldGen        total 41216K, used 0K [0x00007f7123920000, 0x00007f7126160000, 0x00007f714bd20000)
>   object space 41216K, 0% used [0x00007f7123920000,0x00007f7123920000,0x00007f7126160000)
>  PSPermGen       total 21248K, used 5538K [0x00007f711e520000, 0x00007f711f9e0000, 0x00007f7123920000)
>   object space 21248K, 26% used [0x00007f711e520000,0x00007f711ea88b90,0x00007f711f9e0000)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list