elsa-core/src/modules/Elsa.Workflows.Runtime
Sipke Schoorstra f477fc8b07
fix(runtime): bound concurrent pre-cancel snapshot Finds during drain (#8113)
* fix(runtime): bound concurrent pre-cancel snapshot Finds during drain

Unbounded Task.WhenAll of per-cycle Finds self-contends under large
live-cycle N: more 250ms timeouts, more drainInduced excludes, more
Interrupted misses. Cap snapshot Finds at 16. The 250ms budget still
starts only after a slot is acquired so queued Finds are not fail-open
excluded by waiting.

Phase C stays sequential. No store-contract change.

Closes #8083

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(runtime): exclude null pre-cancel snapshots from drainInduced

A successful Find that returns no row is unknown pre-state, not a
confirmed non-Cancelled snapshot. Joining drainInduced let Phase C
rewrite a later Finished/Cancelled as Interrupted. Timeout/error
already excluded; null now does too.

Closes nothing extra; keeps #8083 fail-open exclude.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(runtime): promote null snapshot after Phase A force-cancel

A successful pre-cancel Find that returns no row is not a persisted user-cancel, but excluding it from drainInduced skipped Interrupted persist after deadline-breach force-cancel of a live cycle (DeadlineBreachPersistsInterrupted). Join drainInduced only after we ourselves cancel that handle. Timeout/error and confirmed Cancelled snapshots stay excluded.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix(runtime): promote null snapshot only when TryCancel transitions

Cancel() is a no-op on an already-disposed handle, so treating every Cancel() call as drain-induced could rewrite a Finished/Cancelled row the runner committed while snapshot was in flight. TryCancel reports a real transition; only those ids join drainInduced after a null Find.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-13 17:18:35 +02:00
..
ActivationValidators
Activities fix: stop two silent serialization and test-isolation traps (#7969) 2026-08-21 00:36:11 +02:00
Bookmarks
Commands Add workflow dispatch transactional outbox (#7517) 2026-05-22 00:13:16 +02:00
Comparers Refactor: Overhauls workflow JSON type serialization (#7549) 2026-05-31 11:09:39 +02:00
Constants
Contexts
Contracts Merge pull request #7748 from elsa-workflows/sfmskywalker-fix-commit-state-atomicity 2026-06-23 03:10:36 +02:00
Discovery [codex] Fix console log metadata and type resolution (#7542) 2026-05-30 22:52:01 +02:00
Entities Add bookmark queue dead-letter store (#7516) 2026-05-21 23:43:36 +02:00
Enums Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Exceptions Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Extensions Refactor: Overhauls workflow JSON type serialization (#7549) 2026-05-31 11:09:39 +02:00
Features Fix workflow commit atomicity 2026-06-21 19:58:09 +02:00
Filters Add bookmark queue dead-letter store (#7516) 2026-05-21 23:43:36 +02:00
Handlers Add workflow dispatch transactional outbox (#7517) 2026-05-22 00:13:16 +02:00
HealthChecks Address health check review feedback 2026-05-21 02:13:19 +02:00
HostedServices Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
IngressSources Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Lifecycle Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
LogPersistence
Matches
Messages Adds activity execution call stack support (#7271) 2026-02-24 15:23:59 +01:00
Middleware Add workflow dispatch transactional outbox (#7517) 2026-05-22 00:13:16 +02:00
Models fix(runtime): bound concurrent pre-cancel snapshot Finds during drain (#8113) 2026-09-13 17:18:35 +02:00
Notifications Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
OptionConfigurators Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Options Fix workflow commit atomicity 2026-06-21 19:58:09 +02:00
OrderDefinitions Add bookmark queue dead-letter store (#7516) 2026-05-21 23:43:36 +02:00
Parameters
Params
Providers [codex] Harden workflow JSON type resolution (#7499) 2026-05-22 15:25:49 +02:00
Requests Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Responses Distributed locks to prevent multiple pods executing Reload and Refresh (#7311) 2026-02-23 20:56:15 +01:00
Results
Services fix(runtime): bound concurrent pre-cancel snapshot Finds during drain (#8113) 2026-09-13 17:18:35 +02:00
ShellFeatures Fix workflow commit atomicity 2026-06-21 19:58:09 +02:00
StartupTasks Graceful shutdown for the workflow runtime (drain, pause, recover) (#7424) 2026-05-02 19:27:08 +02:00
Stimuli
Stores fix(persistence): honor tenant isolation in Memory workflow stores (#8100) 2026-09-13 02:56:01 -07:00
Tasks Add workflow dispatch transactional outbox (#7517) 2026-05-22 00:13:16 +02:00
UIHints
AssemblyInfo.cs Add workflow dispatch transactional outbox (#7517) 2026-05-22 00:13:16 +02:00
Elsa.Workflows.Runtime.csproj [codex] Extract dashboard contributors into companion modules (#7692) 2026-06-05 14:30:52 +02:00
Elsa.Workflows.Runtime.csproj.DotSettings
RuntimeStimulusNames.cs
WorkflowRuntimeTypeAliasRegistrar.cs Refactor: Overhauls workflow JSON type serialization (#7549) 2026-05-31 11:09:39 +02:00