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
Encountered a situation where a piece of code was calling cancel(true) on a future runnable but upon inspection Thead.currentThead().isInterrupted() was returning false inside the runnable. The problem is this runnable communicates with sql and the interrupt status/flag is being removed/swallowed by the driver. Specifically the path I encountered was in the login method of SqlServerConnection. The method is using Thead.sleep and is swallowing the InterruptedException. Because Thead.sleep throws InterruptedException when it encounters an interrupt it clears the interrupt status/flag. When execution ultimately returns to the runnable it has no knowledge that an interrupt ever occurred making it impossible for it to act on it. The driver doesn't necessarily need to halt it's execution but in my opinion it should not hide the fact that interrupt occurred.
@jschulist Thank you for finding the issue. We created a PR for it to restore the thread's interrupt status. We hope this will work for you. Thank you.
Encountered a situation where a piece of code was calling cancel(true) on a future runnable but upon inspection Thead.currentThead().isInterrupted() was returning false inside the runnable. The problem is this runnable communicates with sql and the interrupt status/flag is being removed/swallowed by the driver. Specifically the path I encountered was in the login method of SqlServerConnection. The method is using Thead.sleep and is swallowing the InterruptedException. Because Thead.sleep throws InterruptedException when it encounters an interrupt it clears the interrupt status/flag. When execution ultimately returns to the runnable it has no knowledge that an interrupt ever occurred making it impossible for it to act on it. The driver doesn't necessarily need to halt it's execution but in my opinion it should not hide the fact that interrupt occurred.
I'm certainly no expert when it comes to java threading so I'll defer to guidance provided by IBM: https://www.ibm.com/developerworks/library/j-jtp05236/
NOTE: From a quick look through the codebase this is not the only area of concern
The text was updated successfully, but these errors were encountered: