-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: remoting
FilePath.read() will set up the chain of streams like the following:
FastPipedInputStream ^ | FastPipedOutputStream ^ (exported over channel) | ------------------------------- master/slave process boundary | ProxyOutputStream ^ | (thread that pumps IS->OS; Callable in the read method) ^ | FileInputStream
When the channel is lost due to an error, or closed in the middle, then nobody closes FastPipedOutputStream, so the reading end hangs forever.
Somehow we need to call FastPipedOutputStream.error, so that the reader side gets the error.
Also, it is common for the return value from FilePath.read() to be simply pumped into another OutputStream. For this, it is preferable to have FilePath.writeTo() method, and we can avoid creating unnecessary pipe here.