-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
fix AbortPolicyWithReport Semaphore lock not released #13609
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.2 #13609 +/- ##
==========================================
+ Coverage 70.37% 70.38% +0.01%
==========================================
Files 1606 1606
Lines 69997 70001 +4
Branches 10098 10099 +1
==========================================
+ Hits 49260 49271 +11
+ Misses 16111 16099 -12
- Partials 4626 4631 +5 ☔ View full report in Codecov by Sentry. |
@@ -158,6 +158,7 @@ private void dumpJStack() { | |||
} | |||
// To avoid multiple dump, check again | |||
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) { | |||
guard.release(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can move
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
guard.release();
return;
}
ExecutorService pool = Executors.newSingleThreadExecutor();
into try-finally block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry,I didn't unstand.I haven't realized the advantages of moving these codes into try-finally block.
is this what you means?
if (!guard.tryAcquire()) {
return;
}
ExecutorService pool;
try {
// To avoid multiple dump, check again
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
guard.release();
return;
}
pool = Executors.newSingleThreadExecutor();
...........
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guard can be released in the finally block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, please take another look.
28d8079
to
842772d
Compare
|
Co-authored-by: wuzihan <wuzihan@youzan.com>
#13605
What is the purpose of the change
fix AbortPolicyWithReport Semaphore lock not released
Brief changelog