Skip to content

Commit

Permalink
[Hotfix][Zeta] Fix task cannot be stopped when system is busy (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
hailin0 authored Jul 29, 2024
1 parent d886495 commit 3ccc6a8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ private void updateMetricsContextInImap() {
if (localMap.size() > 0) {
try {
if (!metricsImap.tryLock(
Constant.IMAP_RUNNING_JOB_METRICS_KEY, 2, TimeUnit.SECONDS)) {
Constant.IMAP_RUNNING_JOB_METRICS_KEY, 5, TimeUnit.SECONDS)) {
logger.warning("try lock failed in update metrics");
return;
}
Expand All @@ -640,7 +640,11 @@ private void updateMetricsContextInImap() {
"The Imap acquisition failed due to the hazelcast node being offline or restarted, and will be retried next time",
e);
} finally {
metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
try {
metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
} catch (Throwable e) {
logger.warning("unlock imap failed in update metrics", e);
}
}
}
this.printTaskExecutionRuntimeInfo();
Expand Down

0 comments on commit 3ccc6a8

Please sign in to comment.