Skip to content

Commit

Permalink
[Bug][Zeta] Fix TaskExecutionService synchronized lock will not relea…
Browse files Browse the repository at this point in the history
…se (#4886)
  • Loading branch information
Hisoka-X authored Jun 6, 2023
1 parent 5e03d22 commit c7745e6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public void provideDynamicMetrics(
}
}

private synchronized void updateMetricsContextInImap() {
private void updateMetricsContextInImap() {
if (!nodeEngine.getNode().getState().equals(NodeState.ACTIVE)) {
logger.warning(
String.format(
Expand Down Expand Up @@ -542,7 +542,11 @@ private synchronized void updateMetricsContextInImap() {
});
if (localMap.size() > 0) {
try {
metricsImap.lock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
if (!metricsImap.tryLock(
Constant.IMAP_RUNNING_JOB_METRICS_KEY, 2, TimeUnit.SECONDS)) {
logger.info("try lock failed in update metrics");
return;
}
HashMap<TaskLocation, SeaTunnelMetricsContext> centralMap =
metricsImap.computeIfAbsent(
Constant.IMAP_RUNNING_JOB_METRICS_KEY, k -> new HashMap<>());
Expand Down

0 comments on commit c7745e6

Please sign in to comment.