-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling close on a UnixSocket with a pending read waits for the read to time out on Linux #60
Comments
I don't know much about sockets programming, but reading https://www.systutorials.com/docs/linux/man/2-close/ suggests that calling |
…ime. This works around jnr/jnr-unixsocket#60, which is caused by square/okhttp#4233.
@charleskorn Can you propose a PR to fix this? |
Done - #68. |
This also fixes an issue with docker-maven-plugin for me see fabric8io/docker-maven-plugin#552 |
Fix #60 (calling close on a UnixSocket with a pending read waits for the read to time out on Linux)
If you create a
UnixSocket
, set a read timeout and then:read()
on one threadclose()
on another thread...the behaviour is different on OS X and Linux.
On OS X, the read is cancelled as soon as
close()
is called and soclose()
returns immediately. On Linux, the read blocks until the read timeout is reached, and thenclose()
returns.This makes interrupting read operations impossible, and is the root cause of square/okhttp#4233.
I have created a test case that fails on Linux (but passes on OS X) in charleskorn@b0981ae.
The text was updated successfully, but these errors were encountered: