Bug fix where a task could (rarely) be failed and lost if an early timeout extension is done shortly after the task begins.

This commit is contained in:
Stephen Atherton 2018-10-12 14:47:36 -07:00
parent aaf0d0c4c1
commit 356abb099b
1 changed files with 5 additions and 0 deletions

View File

@ -734,6 +734,11 @@ public:
else if(newTimeoutVersion <= version) // Ensure that the time extension is to the future
newTimeoutVersion = version + 1;
// This can happen if extendTimeout is called shortly after task start and the task's timeout was jittered to be longer
if(newTimeoutVersion <= task->timeoutVersion) {
newTimeoutVersion = task->timeoutVersion + 1;
}
// This is where the task definition is being moved to
state Subspace newTimeoutSpace = taskBucket->timeouts.get(newTimeoutVersion).get(task->key);