Skip to content

Fix CancellationToken loss and InProgress metadata orphaning#45

Merged
Theauxm merged 1 commit into
mainfrom
fix/cancellation-token-and-inprogress-gap
Mar 27, 2026
Merged

Fix CancellationToken loss and InProgress metadata orphaning#45
Theauxm merged 1 commit into
mainfrom
fix/cancellation-token-and-inprogress-gap

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 27, 2026

Summary

  • Run(input, metadata, ct) and Run(input, metadata) called Run(input) which hit the 2-param overload Run(TIn, CancellationToken = default), overwriting the real token with CancellationToken.None. This broke dashboard same-server cancellation (via CancellationRegistry.TryCancel) and Lambda timeout propagation. Both now pass the token explicitly.
  • LifecycleHookRunner.OnStarted ran outside the try/catch that calls FinishServiceTrain. If it threw, metadata stayed stuck in InProgress forever. Moved it inside the existing try/catch block.

Test plan

  • 5 new tests for CancellationToken propagation through metadata Run overloads
  • All 358 existing Trax.Effect tests pass
  • Zero build warnings

…ogress gap

Run(input, metadata, ct) and Run(input, metadata) called Run(input) which
overwrote the token with CancellationToken.None, breaking dashboard same-server
cancellation and Lambda timeout propagation.

Moved LifecycleHookRunner.OnStarted inside the main try/catch so any failure
after InProgress is persisted calls FinishServiceTrain instead of orphaning
metadata.
@Theauxm Theauxm merged commit 630276c into main Mar 27, 2026
1 check passed
@Theauxm Theauxm deleted the fix/cancellation-token-and-inprogress-gap branch March 27, 2026 19:11
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 27, 2026

This PR is included in version 1.28.1

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.

1 participant