kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
438 stars 114 forks source link

AFUNIXOutputStream.write Clears Thread Interrupt Flag #51

Closed studansp closed 5 years ago

studansp commented 5 years ago

This call to interrupt has the side effect of clearing the Thread's interrupt flag:

https://github.com/kohlschutter/junixsocket/blob/4fc476b017b2e5f35879a865852f55e87870eb5d/junixsocket-common/src/main/java/org/newsclub/net/unix/AFUNIXSocketImpl.java#L246

https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#interrupted()

The net effect is that write clears the interrupt flag and returns as if the write was successful, but the write was not actually performed.

kohlschuetter commented 5 years ago

This should be fixed in 2.1.0. Please verify. Thanks for reporting!

studansp commented 5 years ago

Verified. Thank you!