mirror of
https://github.com/run-llama/workflows-py.git
synced 2026-07-20 19:57:02 -04:00
Concurrent step not cancelled after StopEvent in 2.14.0 #35
Closed
opened 2026-02-16 02:16:13 -05:00 by yindo
·
7 comments
No Branch/Tag Specified
main
update-debugger-assets
changeset-release/main
adrianbot/mlflow-workflow-tracing-tests
adrianbot/child-workflows-recursive
adrianbot/cw-stack-3-alive-timeout
adrianbot/cw-stack-1-broker-tree
adrian/child-workflows-slim
adrian/llamactl-organizations-use
adrianbot/mlflow-dbos-e2e
adrian/child-workflows-runtime-compat
adrian/child-workflows-durable
adrian/child-workflows
adrian/child-workflow-prep-refactors
adrian/child-workflows-page
adrian/child-workflows-docs
adrian/fan-out-fan-in-l0
claude/centralize-instance-checks-y7ogi1
adrian/fan-out-async-iterator
adrianbot/statedb-go-binary
adrian/workflow-pressure-diagnostics
chore/fix-lint-594
adrian/llamactl-get-split
claude/simplify-mapreduce-syntax-2CPyP
claude/setup-python-311-env-3BfmE
claude/plan-operator-namespace-jzsmq
vasu/retryable_exceptions
chore/fix-lint-525
logan/error-handling
claude/fix-handler-idle-state-SCxQj
claude/organize-examples-KJFTa
clelia/agentcore-memory
adrian/issue-404
changeset-release/dev
adrian/multi-result
claude/fix-database-locked-tests-d2yrv
quickstart
claude/slack-feedback-notification-PehCn
claude/add-durable-workflow-example-YnY23
claude/add-runtime-decorator-abstractions-UJNsv
adrian/mcp
chore/fix-lint-330
adrian/server-decorator
chore/fix-lint-323
claude/test-precommit-fix-sACsb
adrian/store-interface
claude/resolve-package-conflicts-dV32a
claude/add-dbos-test-suite-v0yfb
adrian/wf-registry
claude/relative-workflow-paths-RGVg8
claude/refactor-workflows-server-package-hqICG
claude/release-idle-workflows-VaCpR
logan/child_workflows
logan/building_blocks
adrian/handler-id-quote-issue-53e3
cursor/LI-4612-implement-dedicated-stop-event-subtypes-for-failures-86ee
adrian/test-ctx
cursor/LI-4463-implement-lazy-file-reference-system-b1b3
copilot/sub-pr-202
cursor/LI-3952-generate-workflow-server-reference-docs-0107
cursor/LI-4105-update-wait-for-event-documentation-3bdd
clelia/golden-examples
cursor/LI-3867-refactor-event-api-for-consistency-and-flexibility-dc87
logan/attach_sequence_number_to_events
logan/handler_metadata
adrian/version-bump
cursor/LI-3715-stop-workflow-handler-and-cancel-tasks-807e
cursor/LI-3710-prevent-workflow-server-crash-on-invalid-reload-3421
cursor/LI-3716-filter-internal-events-in-workflow-consumer-eb17
massi/api-reference
clelia/gather-in-step-decorator
v1.3.1
logan/typed_state_poc
llama-agents-server@v0.6.4
llama-agents-server@0.6.4
llama-agents@0.12.5
llama-agents-control-plane@0.12.3
llama-agents-server@0.6.3
llama-agents-server@v0.6.3
llama-index-workflows@2.22.2
llama-agents-client@0.3.11
llama-agents-server@v0.6.2
llama-agents-client@0.3.10
llama-index-workflows@2.22.1
llama-agents-server@0.6.2
llama-agents-dbos@0.4.1
llama-agents-server@v0.6.1
llama-index-workflows@2.22.0
llama-agents-client@0.3.9
llama-agents-server@0.6.1
llama-index-utils-workflow@0.11.0
llamactl@0.10.3
llama-agents-server@0.6.0
llama-index-workflows@2.21.0
llama-agents-dbos@0.4.0
llama-agents-server@v0.6.0
llama-agents-appserver@0.11.5
llama-agents-agentcore@0.9.4
llama-agents@0.12.4
llama-agents-client@0.3.8
llamactl@0.10.2
llamactl@0.10.1
llamactl@0.10.0
llama-agents-control-plane@0.12.2
llama-agents-appserver@0.11.4
llama-agents@0.12.3
llama-agents-agentcore@0.9.3
llama-agents-core@0.10.2
llama-agents-dbos@0.3.1
llama-agents-dbos@0.3.0
llamactl@0.9.1
llama-agents-server@0.5.0
llama-agents-core@0.10.1
llamactl@0.9.0
llama-agents-control-plane@0.12.1
llama-agents-appserver@0.11.3
llama-agents-agentcore@0.9.2
llama-agents-server@v0.5.0
llama-agents@0.12.2
llama-agents-dbos@0.2.3
llama-agents@0.12.1
llama-agents-appserver@0.11.2
llama-agents-core@0.10.0
llama-agents-agentcore@0.9.1
llamactl@0.8.0
llama-agents-control-plane@0.12.0
llamactl@0.7.3
llama-index-workflows@2.20.0
llama-agents@0.12.0
llama-agents-server@v0.4.7
llama-agents-server@0.4.7
llama-agents-client@0.3.7
llamactl@0.7.2
llama-index-workflows@2.19.1
llama-agents-client@0.3.6
llama-agents-agentcore@0.9.0
llama-agents-appserver@0.11.1
llama-agents-server@v0.4.6
llama-agents-dbos@0.2.2
llama-agents-server@0.4.6
llama-agents@0.11.1
llama-agents-appserver@0.11.0
llama-agents-control-plane@0.11.1
llama-agents-agentcore@0.8.19
llamactl@0.7.1
llama-agents@0.11.0
llama-agents-operator@0.11.1
llama-agents-agentcore@0.8.18
llama-agents-crds@0.7.2
llama-agents@0.10.12
llama-agents-server@v0.4.5
llama-agents-client@0.3.5
llama-agents-server@0.4.5
llama-index-workflows@2.19.0
llamactl@0.7.0
llama-agents-core@0.9.0
llama-agents-appserver@0.10.5
llama-agents-server@0.4.4
llama-agents-control-plane@0.11.0
llama-agents-client@0.3.4
llama-index-workflows@2.18.0
llama-agents@0.10.11
llama-agents-agentcore@0.8.17
llama-agents-server@v0.4.4
llama-agents-agentcore@0.8.16
llama-agents-agentcore@0.8.15
llama-agents-server@0.4.3
llama-agents-server@v0.4.3
llama-agents-core@0.8.5
llamactl@0.6.9
llama-agents-control-plane@0.10.5
llama-agents-appserver@0.10.4
llama-agents-agentcore@0.8.14
llama-agents@0.10.10
llama-agents-server@0.4.2
llama-agents-agentcore@0.8.13
llama-agents-server@v0.4.2
llama-agents-appserver@0.10.3
llamactl@0.6.8
llama-agents@0.10.9
llama-agents-agentcore@0.8.12
llama-agents@0.10.8
llamactl@0.6.7
llama-agents-control-plane@0.10.4
llama-agents-agentcore@0.8.11
llama-agents-server@0.4.1
llama-agents-server@v0.4.1
llama-agents-agentcore@0.8.10
llama-agents-agentcore@0.8.9
llama-agents-agentcore@0.8.8
llama-index-workflows@2.17.3
llama-agents-server@0.4.0
llama-agents-client@0.3.3
llama-index-workflows@2.17.2
llama-agents-server@0.3.3
llama-agents-client@0.3.2
llama-agents-server@v0.3.2
llama-agents-server@0.3.2
llama-agents-dbos@0.2.1
llama-index-workflows@2.17.1
llama-agents-server@0.3.1
llama-agents-server@v0.3.1
llama-index-utils-workflow@0.10.1
llama-agents-client@0.3.1
llama-index-utils-workflow@0.10.0
llama-agents-dbos@0.2.0
llama-agents-client@0.3.0
llama-agents-server@v0.3.0
llama-agents-server@0.3.0
llama-index-workflows@2.17.0
llama-agents-server@v0.2.3
llama-agents-server@0.2.3
llama-agents-client@0.2.3
llama-index-workflows@2.16.1
llama-index-workflows@2.16.0
llama-index-utils-workflow@0.9.5
llama-agents-dbos@0.1.2
llama-agents-server@v0.2.2
llama-agents-client@0.2.2
llama-agents-server@0.2.2
llama-index-workflows@2.15.1
llama-agents-client@0.2.1
llama-agents-server@0.2.1
llama-agents-dbos@0.1.1
llama-index-utils-workflow@0.9.4
llama-agents-server@v0.2.1
llama-index-utils-workflow@0.9.3
llama-index-workflows@2.15.0
llama-agents-dbos@0.1.0
llama-agents-server@v0.2.0
llama-agents-server@0.2.0
llama-agents-client@0.2.0
llama-index-workflows@2.15.0-rc.1
llama-agents-client@0.2.0-rc.1
llama-index-utils-workflow@0.9.3-rc.1
llama-agents-server@0.2.0-rc.3
llama-agents-dbos@0.1.0-rc.1
llama-agents-server@0.1.3
llama-index-utils-workflow@0.9.2
llama-agents-server@v0.1.3
llama-agents-client@0.1.3
llama-index-workflows@2.14.2
llama-agents-server@0.2.0-rc.2
llama-agents-dbos@0.1.0-rc.0
llama-agents-server@0.2.0-rc.1
llama-agents-client@0.2.0-rc.0
llama-index-utils-workflow@0.9.2-rc.0
llama-index-workflows@2.15.0-rc.0
llama-agents-server@0.2.0-rc.0
llama-agents-server@v0.2.0-rc.0
llama-agents-client@0.1.2
llama-index-utils-workflow@0.9.1
llama-index-workflows@2.14.1
llama-agents-server@v0.1.2
llama-agents-server@0.1.2
llama-agents-server@v0.1.1
llama-index-utils-workflow@0.9.0
llama-agents-client@0.1.1
llama-agents-server@0.1.1
llama-index-workflows@2.14.0
llama-index-workflows@2.13.1
llama-index-workflows@v2.13.1
llama-index-workflows@2.13.0
llama-index-utils-workflow@0.8.0
llama-index-workflows@v2.13.0
llama-index-workflows@2.12.2
llama-index-workflows@v2.12.2
llama-index-utils-workflow@0.7.1
llama-index-workflows@v2.12.1
llama-index-workflows@2.12.1
llama-index-workflows@2.12.0
llama-index-utils-workflow@0.7.0
llama-index-workflows@v2.12.0
llama-index-utils-workflow@0.6.0
llama-index-workflows@v2.11.7
llama-index-workflows@2.11.7
llama-index-workflows@v2.11.6
llama-index-workflows@2.11.6
llama-index-utils-workflow@0.5.2
llama-index-workflows@2.11.5
llama-index-workflows@v2.11.5
llama-index-workflows@v2.11.4
llama-index-workflows@2.11.4
llama-index-utils-workflow@0.5.1
llama-index-workflows@2.11.3
llama-index-workflows@v2.11.3
llama-index-workflows@2.11.2
llama-index-utils-workflow@0.5.0
llama-index-workflows@v2.11.2
llama-index-workflows@v2.11.1
v2.11.1
v2.11.0
v2.10.3
v2.10.2
v2.10.1
v2.10.0
v2.9.1
v2.9.0
llama-index-utils-workflow@v0.5.0
v2.8.3
v2.8.2
v2.8.1
v2.8.0
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.0
v2.3.0
v2.2.2
v2.2.1
v2.2.0
v2.1.0
v2.0.1
v2.0.0
v1.3.0
v1.2.0
v1.1.0
v1.0.1
v1.0.0
v0.2.2
v0.2.1
v0.2.0
v0.1.0
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: run-llama/workflows-py#35
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @schelv on GitHub (Feb 6, 2026).
After upgrading from llama-index-workflows 2.13.1 to 2.14.0, one of my workflow tests started failing.
The workflow has two concurrent steps. The test covers the case where one step finishes early and returns a StopEvent, which should cancel the other concurrent step.
Expected behavior (2.13.1)
Event stream:
Actual behavior (2.14.0)
Event stream:
It looks like
StopEventno longer cancels the running concurrent steps in 2.14.0.@adrianlyjak commented on GitHub (Feb 6, 2026):
@schelv can you share a bit more about the structure of your workflow and the test so I can recreate it precisely?
OtherEventappears in the event stream: are you callingctx.write_event_to_streamwithin the steps? Or is this an implicit publish to the event stream via anInputRequiredEvent?@adrianlyjak commented on GitHub (Feb 6, 2026):
Another thing I'm noticing is that you mention the event stream is
This is the actual order of events you see? This seems like the simultaneous event is published before the final stop event step is fully committed. Not reflective of whether the first step has been cancelled or not, but rather a variation in timing introduced in the new release.
@adrianlyjak commented on GitHub (Feb 6, 2026):
@schelv I was able to recreate on a test comparing 2.13.1 to 2.14.0. Appreciate if you could retry your test on 2.14.1 (should be released by the time you read this). Feel free to re-open if you still see any issues!
@schelv commented on GitHub (Feb 6, 2026):
I will test it after the weekend😀
@schelv commented on GitHub (Feb 9, 2026):
I was able to test the new release.
It looks like the problem is solved in some cases.
For my tests I've managed to fix the problem by adding some sleep timeout.
I've tried to create a minimal test example to see how adding sleep timeout solves the problem.
When I add some timeout everything works fine.
But when I set the sleep timeout to 0 I'm still able getting an event in the event stream that shouldn't be there (because the workflow should have already stopped).
Here is my attempt at a minimal example (it is probably not minimal):
With
sleep_duration = 0gives output:note that OtherStreamEvent() appears even when check_passes=False, where the workflow should stop early.
@adrianlyjak commented on GitHub (Feb 9, 2026):
@schelv, from what I understand, this looks expected.
Steps for the same event run concurrently (here, there's two parallel paths triggered from
StartEvent, that creates a race condition in the structure of the workflow. For the case ofslow_step="check_step"andcheck_passes=False, with asleep(0), that's enough yield to allow the other fast path to quickly iterate through its sequentialinitialization_step -> some_other_step. Oncesome_other_stepis running, it will quickly reach thewrite_event_to_stream.Structurally I'd recommend some kind of waiting condition if you need to avoid the publishing until you're confident that the check passes. Some ideas:
ctx.write_event_to_stream(OtherStreamEvent())intosome_third_stepafter thectx.collect_eventsare collected, orinitialization_stepfromCheckPassedEventinstead ofStartEventCheckPassedEventevents earlier to guard from publishing, either fromsome_third_stepinto theinitialization_steporsome_other_step@schelv commented on GitHub (Feb 10, 2026):
@adrianlyjak Thank you for looking into it.
The problem was mainly that my previous tests had some implicit assumption about order.
The new version of the package brought those assumptions to the surface and made me fall into the asyncio rabbit hole.
I've crawled out, fixed my test, and am moving on. 😀
Thank you again for looking into things!