Skip to content

Commit 68c42fc

Browse files
committed
Check allocationIdOnLastStatusUpdate when trying to detect whether a task is stale.
1 parent 45ad056 commit 68c42fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/persistent/PersistentTasksCustomMetaData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public Status getStatus() {
366366
* to a new executor node and the status hasn't been updated then the task status is stale.
367367
*/
368368
public boolean isCurrentStatus() {
369-
return allocationIdOnLastStatusUpdate == allocationId;
369+
return allocationIdOnLastStatusUpdate != null && allocationIdOnLastStatusUpdate == allocationId;
370370
}
371371

372372
@Override

0 commit comments

Comments
 (0)