Skip to content

Commit b156308

Browse files
committed
Fix possible error with evictions on wf complete
1 parent d7e0747 commit b156308

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,18 @@ def activate(
385385
for index, job_set in enumerate(job_sets):
386386
if not job_set:
387387
continue
388+
had_non_evict = False
388389
for job in job_set:
389390
# Let errors bubble out of these to the caller to fail the task
390391
self._apply(job)
392+
if not job.HasField("remove_from_cache"):
393+
had_non_evict = True
391394

392395
# Run one iteration of the loop. We do not allow conditions to
393396
# be checked in patch jobs (first index) or query jobs (last
394-
# index).
395-
self._run_once(check_conditions=index == 1 or index == 2)
397+
# index). No need to wake up if all we're doing is evicting.
398+
if had_non_evict:
399+
self._run_once(check_conditions=index == 1 or index == 2)
396400
except Exception as err:
397401
# We want some errors during activation, like those that can happen
398402
# during payload conversion, to be able to fail the workflow not the

0 commit comments

Comments
 (0)