Yes, I think we're all on the same page now.

> So, can we please have a realistic plan to review each change from 4b82e6a, 
> proposing realistic solution to any issues found?

The goal of 4b82e6a, if I understand correctly, was to avoid passing around 
stream implementations that override finalize(), for GC performance reasons. 
Getting threads to interrupt more promptly than before is a "nice-to-have", but 
really a separate enhancement that can be postponed.

With this in mind, there is a solution which achieves what 4b82e6a intended to 
achieve (dropping finalize()), without changing interrupt-related behavior: 
Wrap the NIO streams in new InputStream/OutputStream classes, which delegate to 
them but which catch and retry on ClosedByInterruptException. Then use these 
classes in all places where explicit interrupt handling has not been deemed to 
be safe.

(See also 
https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html 
for the equivalent problem in the UNIX world. Retrying on interrupt is the 
common solution.)

[ Full content available at: 
https://github.com/apache/incubator-netbeans/pull/854 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to