Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit d0cb464

Browse files
chamikaramjgildea
authored andcommitted
Marking WorkItems DONE before releasing the lock.
Without this, there is the slight chance of an extra progress report being sent resulting in unnecessary lease expiration errors. ----Release Notes---- [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117271848
1 parent c6efa09 commit d0cb464

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

google/cloud/dataflow/worker/batchworker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ def do_work(self, work_item):
407407
with work_item.lock:
408408
self.report_completion_status(work_item,
409409
exception_details=exception_details)
410+
work_item.done = True
410411
else:
411412
self.report_progress = False
412413
with work_item.lock:
413414
self.report_completion_status(work_item)
414-
with work_item.lock:
415-
work_item.done = True
415+
work_item.done = True
416416

417417
def status_server(self):
418418
"""Executes the serving loop for the status server."""

0 commit comments

Comments
 (0)