commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siegfried Goeschl (JIRA)" <j...@apache.org>
Subject [jira] [Created] (EXEC-99) Provide a non-blocking PumpStreamHandler
Date Sat, 09 Jan 2016 10:18:39 GMT
Siegfried Goeschl created EXEC-99:
-------------------------------------

             Summary: Provide a non-blocking PumpStreamHandler
                 Key: EXEC-99
                 URL: https://issues.apache.org/jira/browse/EXEC-99
             Project: Commons Exec
          Issue Type: Improvement
    Affects Versions: 1.3
            Reporter: Siegfried Goeschl
            Assignee: Siegfried Goeschl
             Fix For: 1.4


Sometimes the current PumpStreamHandler when a process is killed but its child process streams
are processed by PumpStreamHandler

* Closing the processed stream does seem not work 
* Using Thread.interrupt() does not work
* Thread.stop() is deprecated and has no effect on JDK 8
* Hence the the stream pumper thread is stuck and can't terminate
* So we hand in PumpStreamHandler().stop

There was a bug fix to avoid hanging forever but this leaves the pumper thread behind which
could break a production system.

As a work-around I propose a "NonBlockingPumpStreamHandler" 

* use only on worker thread to process a streams
* using Thread.sleep() between processing of the streams
* can be stopped safely since there are no blocking operations
* it will be much slower processing the streams which could block the child process

It might be a good idea to hide those implementation behind a factory





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message