Skip to content

Commit 5270251

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

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
@@ -391,8 +391,12 @@ def activate(
391391

392392
# Run one iteration of the loop. We do not allow conditions to
393393
# be checked in patch jobs (first index) or query jobs (last
394-
# index).
395-
self._run_once(check_conditions=index == 1 or index == 2)
394+
# index). No need to wake up if all we're doing is evicting.
395+
is_only_evict = all(
396+
[job.HasField("remove_from_cache") for job in job_set]
397+
)
398+
if not is_only_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)