Skip to content
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

Improper handling of thread interrupts while derefing a promise #74

Open
aengelberg opened this issue Oct 4, 2016 · 0 comments
Open

Comments

@aengelberg
Copy link

I'm experiencing issues in riemann-clojure-client that I believe can be traced to the following issues in the java client.

When derefing the promise while the thread gets interrupted, I get a NullPointerException. When derefing the promise with a timeout while the thread gets interrupted, the timeout value is returned. Most importantly, in either case, the thread interrupt gets swallowed and the Thread.interrupted() flag stays false, which prevents the calling thread from ever being able to stop. Actually, coincidentally the thread is stopping in the non-timeout case because of the NullPointerException.

I'm not sure if returning nil or the timeout value is intended behavior in the interrupt scenario, but I believe at the very least, both methods should call Thread.currentThread().interrupt() before returning, to allow the interrupted thread to at least see that it is interrupted and exit accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant