Copilot commented on code in PR #9427:
URL: https://github.com/apache/seatunnel/pull/9427#discussion_r2141643385
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/master/JobMaster.java:
##########
@@ -913,7 +915,11 @@ public void removeMetricsContext(
boolean unLockedIMap = false;
while (!unLockedIMap) {
try {
-
metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
+ if (System.currentTimeMillis() - lockTs > 5000) {
Review Comment:
[nitpick] Extract the hardcoded `5000`ms into a named constant (e.g.
`MAX_UNLOCK_DURATION_MS`) and consider encapsulating the retry-with-timeout
logic into a shared helper to reduce duplication.
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/TaskExecutionService.java:
##########
@@ -627,7 +629,11 @@ private void updateMetricsContextInImap() {
boolean unLockedIMap = false;
while (!unLockedIMap) {
try {
-
metricsImap.unlock(Constant.IMAP_RUNNING_JOB_METRICS_KEY);
+ if (System.currentTimeMillis() - lockTs > 5000) {
Review Comment:
[nitpick] Extract the hardcoded `5000`ms into a named constant (e.g.
`MAX_UNLOCK_DURATION_MS`) and consider encapsulating the retry-with-timeout
logic into a shared helper to reduce duplication.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]