Thank you Alan!
Yes, I missed that fact that reading from the recycled file descriptor
is actually a problem by itself.
Would you please take a look at another updated webrev?
It contains another implementation suggested by Paul Sandoz with some
minor changes.
http://cr.openjdk.java.net/~igerasim/8024521/2/webrev/
<http://cr.openjdk.java.net/%7Eigerasim/8024521/2/webrev/>
Here we synchronize close() with calls to available() and read() and
check for asynchronous close() that could have happened in between.
Sincerely yours,
Ivan
On 17.10.2013 16:34, Alan Bateman wrote:
On 15/10/2013 16:31, Ivan Gerasimov wrote:
Here's the updated webrev with the solution by Paul:
http://cr.openjdk.java.net/~igerasim/8024521/1/webrev/
I've also excluded the test from it.
Instead, I'm going to write a manual testing instruction for SQE.
I've tested the fix and it works as expected.
I've looked at the updated webrev but there still appears to be an
issue if the application closes the stream at just around the time
that the process exits. So I think you will need to go back to a
solution along the lines of the first patch so there is coordination
between the process exit and the close.
-Alan.