You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2019/02/27 01:20:34 UTC
[helix] branch master updated: Fix race condition for purging jobs
immediately after job completes
This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new 7a62f74 Fix race condition for purging jobs immediately after job completes
7a62f74 is described below
commit 7a62f74949f98d6629fc7efa29aae789c23f6356
Author: Junkai Xue <jx...@linkedin.com>
AuthorDate: Wed Feb 20 14:06:13 2019 -0800
Fix race condition for purging jobs immediately after job completes
---
helix-core/src/main/java/org/apache/helix/task/TaskUtil.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/helix-core/src/main/java/org/apache/helix/task/TaskUtil.java b/helix-core/src/main/java/org/apache/helix/task/TaskUtil.java
index 8392d89..42467eb 100644
--- a/helix-core/src/main/java/org/apache/helix/task/TaskUtil.java
+++ b/helix-core/src/main/java/org/apache/helix/task/TaskUtil.java
@@ -731,7 +731,8 @@ public class TaskUtil {
expiry = workflowConfig.getExpiry();
}
if (jobContext != null && jobStates.get(job) == TaskState.COMPLETED) {
- if (System.currentTimeMillis() >= jobContext.getFinishTime() + expiry) {
+ if (jobContext.getFinishTime() != WorkflowContext.UNFINISHED
+ && System.currentTimeMillis() >= jobContext.getFinishTime() + expiry) {
expiredJobs.add(job);
}
}