|
|
|
[
Permlink
| « Hide
]
Dan Diephouse - 11/Sep/06 04:51 PM
I take it this worked fine before 1.2.1? I wonder whats going on here....
Dan,
There is a piped stream between the two, which is being closed in the writer thread and the main, as in this case the fault is being thrown before the full message is read the main thread is exiting and closing the piped stream while the writer thread is still writing the main message out. (above is a theory). I think we could resolve this by moving all of the stream/reader/writer closes to be done after the writeThread.join, that way we know we are not using the streams any more. I think that should solve the issue Paul That is a good suggestion. I'll have to look into it...
Dan,
The following fixes solve the problem. The first is replacing the exception in the thread with a log statement, the exception just gets caught and dumped to stderr by the thread handler, so we may as well just log it. The second is making sure that the whole request message was read before closing the stream, this makes sure the write thread does not bail An alternate option to this fix would be to catch IOExceptions and ignore them but log any other exceptions in the write thread. This would be more efficient as you don't have to wait for the whole message to be written Index: local/LocalChannel.java } @@ -170,7 +170,9 @@ channel.receive( receivingContext, inMessage ); Thanks Paul, your patches and feedback are always helpful! I applied the reader.next() fix to SVN. We probably only have two end tags which we haven't read, so I doubt the performance impact will be much.
|
||||||||||||||||||||||||||||||||||||||||||||