Skip to content

Fixed synchronization of multiple recovery workflows#822

Merged
GlassOfWhiskey merged 17 commits intomasterfrom
fix/ft-sync
Mar 23, 2026
Merged

Fixed synchronization of multiple recovery workflows#822
GlassOfWhiskey merged 17 commits intomasterfrom
fix/ft-sync

Conversation

@LanderOtto
Copy link
Copy Markdown
Collaborator

@LanderOtto LanderOtto commented Oct 7, 2025

This commit improves the synchronization of concurrent recovery workflows. Previously, an error occurred when a dependent workflow attempted to attach to an InterWorkflowPort of the dependee before it was created. This race condition happened because port creation occurred in a successor phase of job synchronization. This is now resolved by acquiring a lock to check the status and holding it until the recovery workflow responsible for the rollback is ready.

Additionally, this commit fixes the move_token_to_root and remove_port methods. Token movement now correctly drives port deletion; previously, port deletion drove token deletion, which occasionally resulted in an empty token graph.

Finally, this commit corrects the status precedence in the _reduce_statuses function. The FAILED and CANCELLED statuses now take priority over RECOVERED.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 88.23529% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.13%. Comparing base (e14ca29) to head (6da15e7).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
streamflow/recovery/policy/recovery.py 84.61% 2 Missing and 2 partials ⚠️
streamflow/recovery/failure_manager.py 90.90% 1 Missing ⚠️
streamflow/recovery/utils.py 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #822      +/-   ##
==========================================
+ Coverage   73.83%   74.13%   +0.30%     
==========================================
  Files          91       91              
  Lines       12492    12471      -21     
  Branches     2191     2180      -11     
==========================================
+ Hits         9223     9245      +22     
+ Misses       2744     2712      -32     
+ Partials      525      514      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LanderOtto LanderOtto force-pushed the fix/ft-sync branch 4 times, most recently from 3c91bed to 7f85ef4 Compare October 9, 2025 15:23
@GlassOfWhiskey GlassOfWhiskey force-pushed the master branch 7 times, most recently from b21f362 to e7820f1 Compare January 12, 2026 08:25
@GlassOfWhiskey GlassOfWhiskey force-pushed the master branch 4 times, most recently from 8c05dac to 4a6edc9 Compare January 24, 2026 13:16
@LanderOtto LanderOtto marked this pull request as ready for review February 4, 2026 08:31
Comment thread streamflow/workflow/port.py Fixed
@LanderOtto LanderOtto marked this pull request as draft February 6, 2026 16:50
…ected tags, instead of a single upper tag. Before this commit, the scatter can be prone to errors when the max tag is generated before the other ones.
# Conflicts:
#	.github/workflows/ci-tests.yaml
#	.github/workflows/release.yml
#	pyproject.toml
#	streamflow/cwl/command.py
#	streamflow/cwl/processor.py
#	streamflow/cwl/utils.py
#	streamflow/data/manager.py
#	streamflow/data/utils.py
#	streamflow/persistence/sqlite.py
#	streamflow/recovery/policy/recovery.py
#	streamflow/recovery/utils.py
#	streamflow/workflow/combinator.py
#	streamflow/workflow/port.py
#	streamflow/workflow/step.py
#	tests/test_recovery.py
#	tests/utils/workflow.py
#	uv.lock
# Conflicts:
#	streamflow/recovery/policy/recovery.py
#	streamflow/workflow/port.py
# Conflicts:
#	streamflow/core/recovery.py
#	streamflow/recovery/policy/recovery.py
#	streamflow/recovery/utils.py
@LanderOtto LanderOtto marked this pull request as ready for review March 23, 2026 11:21
@LanderOtto LanderOtto force-pushed the fix/ft-sync branch 3 times, most recently from 243acb7 to b137e39 Compare March 23, 2026 14:46
Copy link
Copy Markdown
Member

@GlassOfWhiskey GlassOfWhiskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GlassOfWhiskey GlassOfWhiskey merged commit b963a1e into master Mar 23, 2026
41 checks passed
@GlassOfWhiskey GlassOfWhiskey deleted the fix/ft-sync branch March 23, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants