-
Notifications
You must be signed in to change notification settings - Fork 426
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
SharedTimer race condition #2084
Comments
mmimica
pushed a commit
to mmimica/mssql-jdbc
that referenced
this issue
Feb 28, 2023
Introduced by #1931 |
Hi @mmimica, Thank you for finding this, we'll take a look at the issue and the PR and get back to you on how we'd like to proceed. |
I think I stumbled over this problem in production since upgrading from
|
Yes, this is the usual consequence. Setting |
Jeffery-Wasty
pushed a commit
that referenced
this issue
Mar 14, 2023
* Merge dev to master for 9.2.0 release (#1506) Merge dev to master for 9.2.0 release (#1506) * fix merge * Fix #2084 by not using double-lock check. * Simplify the test a bit. * Simplify the test a bit. * test rewritten for old compatibility --------- Co-authored-by: ulvii <v-ulibra@microsoft.com> Co-authored-by: Peter Bae <v-hyba@microsoft.com> Co-authored-by: Milan Mimica <milan.mimica@infobip.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Driver version
12.2.0.jre11
Problem description
There is a race-condition in
SharedTimer
class.The class holds a singleton instance of a
ScheduledThreadPoolExecutor
and keeps a reference count. It disposes the executor instance when reference count reaches 0. Because of ineffective use of double-lock check pattern in SharedTimer#getTimer the reference counter is prone to race-conditions.The problem escalates with dawn of "Connection Resiliency" feature which is enabled by default. It can be mitigated by setting
connectRetryCount
connection property to 0.The text was updated successfully, but these errors were encountered: