You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed an issue with how thread interruption handling is managed. I couldn't find any mention of this behaviour in the docs, and I'm not sure whether it's expected.
Jsoup appears to clear the interruption flag of the calling thread during I/O operations, which, I believe, leads to unexpected behaviour when trying to manage thread interruption.
I've noticed an issue with how thread interruption handling is managed. I couldn't find any mention of this behaviour in the docs, and I'm not sure whether it's expected.
Jsoup appears to clear the interruption flag of the calling thread during I/O operations, which, I believe, leads to unexpected behaviour when trying to manage thread interruption.
Consider the following client code:
The interruption flag is being cleared through
java.lang.Thread#interrupted
inConstrainableInputStream.java
:jsoup/src/main/java/org/jsoup/internal/ConstrainableInputStream.java
Lines 49 to 56 in 1762412
I would expect either the interruption flag to be preserved or
java.lang.InterruptedException
to be thrown by Jsoup.Please let me know if that behaviour is indeed unexpected. I will try to come up with a suitable solution and open a PR. Thanks!
The text was updated successfully, but these errors were encountered: