You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by "Brian Foster (JIRA)" <ji...@apache.org> on 2011/02/17 23:27:12 UTC

[jira] Created: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
----------------------------------------------------------------------------------

                 Key: OODT-145
                 URL: https://issues.apache.org/jira/browse/OODT-145
             Project: OODT
          Issue Type: Bug
          Components: commons
    Affects Versions: 0.2
         Environment: none
            Reporter: Brian Foster
            Assignee: Brian Foster
            Priority: Minor
             Fix For: 0.3



This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 

java.io.IOException: Stream closed
	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
	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)
	at java.io.InputStreamReader.read(InputStreamReader.java:167)
	at java.io.BufferedReader.fill(BufferedReader.java:136)
	at java.io.BufferedReader.readLine(BufferedReader.java:299)
	at java.io.BufferedReader.readLine(BufferedReader.java:362)
	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

java.io.IOException: Bad file descriptor
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:199)
	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
	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)
	at java.io.InputStreamReader.read(InputStreamReader.java:167)
	at java.io.BufferedReader.fill(BufferedReader.java:136)
	at java.io.BufferedReader.readLine(BufferedReader.java:299)
	at java.io.BufferedReader.readLine(BufferedReader.java:362)
	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)


-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Foster updated OODT-145:
------------------------------

    Attachment: StreamGobber.OODT-145.2011-02-17.patch.txt


-attached patch which uses thread synchronization to accomplish the wait until gobbler dies

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996581#comment-12996581 ] 

Brian Foster commented on OODT-145:
-----------------------------------

nice . . . with the above recommendation and a few extra mods (private -> protected) to StreamGobbler i was able to piece a UnitTest together . . . however, new problem! . . . it appears that not only was our code sometime prematurely killing the process's iostreams but also, depending on which platform you are running the code, the Process implementation for some JVMs will call it's destroy() method prematurely . . . so this UnitTest would become platform dependent -- not cool of course . . . so let's forget the my original patch and instead have the StreamGobbler send it's exception capturing to the Java Logger as FINEST instead of to stdout so by default it is silenced.

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt, StreamGobbler.OODT-145.2011-02-18.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996159#comment-12996159 ] 

Brian Foster commented on OODT-145:
-----------------------------------

- actually i looked in to writing an unit-test and i can't write a unit-test to prove it because the exception that gets thrown in is the StreamGobbler's run thread which i don't have access to . . . my proof that it works is in running it with the current version which prints out the exceptions stack trace and then running with my patch version and the exception not getting thrown

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Foster resolved OODT-145.
-------------------------------

    Resolution: Fixed

- fixed in r1073835

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt, StreamGobbler.OODT-145.2011-02-18.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996127#comment-12996127 ] 

Chris A. Mattmann commented on OODT-145:
----------------------------------------

Hi Brian,

Thanks. Can you attach a unit test for forward regression on this? Also just wondering how your patch fixes it -- not because I don't agree with it, but mainly b/c I don't understand. Thanks!


> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996970#comment-12996970 ] 

Chris A. Mattmann commented on OODT-145:
----------------------------------------

Brian, +1 to your patch. Good job working through the issues.

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt, StreamGobbler.OODT-145.2011-02-18.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996136#comment-12996136 ] 

Brian Foster commented on OODT-145:
-----------------------------------

- will do on the unit test
- the synchronize solves this basically because synch_run gives the StreamGobbler's object monitor to the thread which is created when the start() is called on StreamGobber, therefore when the ExecUtils (i.e. in a different Thread) calls stopGobblingAndDie() which first sets the boolean to false which cause the synch_run to start termination then stopGobblingAndDie() calls a synchronized method with causes it to wait until synch_run finishes and gives up the object's monitor

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Brian Foster (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Foster updated OODT-145:
------------------------------

    Attachment: StreamGobbler.OODT-145.2011-02-18.patch.txt

- attached patch per comment above

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt, StreamGobbler.OODT-145.2011-02-18.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (OODT-145) StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead

Posted by "Chris A. Mattmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OODT-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12996232#comment-12996232 ] 

Chris A. Mattmann commented on OODT-145:
----------------------------------------

Hey Brian, couldn't we just sublcass StreamGobbler, and then @Override its run method with something like:

{code}
class TestStreamGobbler extends TestCase{


  class StreamGobblerTester extends StreamGobbler{
    private TestCase test;

    public StreamGobblerTester(TestCase t){
       this.test = t;
    }

  @Override
  public void run(){
    try{
      super.run();
    }
    catch(Exception e){
      test.fail(e.getMessage());
    }
  }
 }
{code}

> StreamGobbler stopGobblingAndDie() method doesn't wait until gobble is really dead
> ----------------------------------------------------------------------------------
>
>                 Key: OODT-145
>                 URL: https://issues.apache.org/jira/browse/OODT-145
>             Project: OODT
>          Issue Type: Bug
>          Components: commons
>    Affects Versions: 0.2
>         Environment: none
>            Reporter: Brian Foster
>            Assignee: Brian Foster
>            Priority: Minor
>             Fix For: 0.3
>
>         Attachments: StreamGobber.OODT-145.2011-02-17.patch.txt
>
>
> This causes the streams in ExecUtils to close its output and input streams before the gobbler finishes it's flush causing the following errors: 
> java.io.IOException: Stream closed
> 	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)
> java.io.IOException: Bad file descriptor
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:199)
> 	at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
> 	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)
> 	at java.io.InputStreamReader.read(InputStreamReader.java:167)
> 	at java.io.BufferedReader.fill(BufferedReader.java:136)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:299)
> 	at java.io.BufferedReader.readLine(BufferedReader.java:362)
> 	at org.apache.oodt.commons.exec.StreamGobbler.run(StreamGobbler.java:67)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira