-
Notifications
You must be signed in to change notification settings - Fork 271
[world-vercel] [builders] Add ENFORCE_STRICT_CONCURRENCY option to limit flow route concurrency to one #2193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
VaguelySerious
wants to merge
9
commits into
stable
Choose a base branch
from
peter/enforce-strict-concurrency
base: stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+287
−62
Draft
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
44bcea5
[world-vercel] [core] Add option to limit queue concurrency to one
VaguelySerious 68a058d
TEMP: force strict concurrency on for CI (revert before merge)
VaguelySerious 012234b
[e2e] Make event-log-race-repro summary actionable: full regression l…
VaguelySerious 32adc82
[e2e] Capture where a stuck repro run wedged
VaguelySerious b99c748
[e2e] Treat slow-but-completed repro runs as non-gating, not stuck
VaguelySerious 9f465e5
[e2e] Retry transient fetch failures in the repro harness; label wher…
VaguelySerious b5ae489
[e2e] Classify polled run failures from the structured error, not a m…
VaguelySerious f126a99
Merge remote-tracking branch 'origin/stable' into peter/enforce-stric…
VaguelySerious 4baa79d
Restore strict concurrency as explicit opt-in
pranaygp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@workflow/world-vercel": minor | ||
| "@workflow/builders": minor | ||
| "@workflow/next": minor | ||
| "@workflow/sveltekit": patch | ||
| --- | ||
|
|
||
| Add opt-in `ENFORCE_STRICT_CONCURRENCY` env var. When set to `1`, flow (orchestrator) routes are limited to one invocation per run at a time via a per-run queue topic and `maxConcurrency: 1` on the flow trigger. Step routes are unaffected. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import { afterEach, beforeEach, describe, expect, it } from 'vitest'; | ||
|
|
||
| import { getWorkflowQueueTrigger, STEP_QUEUE_TRIGGER } from './constants.js'; | ||
|
|
||
| describe('getWorkflowQueueTrigger', () => { | ||
| let originalStrict: string | undefined; | ||
|
|
||
| beforeEach(() => { | ||
| originalStrict = process.env.ENFORCE_STRICT_CONCURRENCY; | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| if (originalStrict !== undefined) { | ||
| process.env.ENFORCE_STRICT_CONCURRENCY = originalStrict; | ||
| } else { | ||
| delete process.env.ENFORCE_STRICT_CONCURRENCY; | ||
| } | ||
| }); | ||
|
|
||
| // TEMP(ci-default-on): skipped while strict concurrency is forced on for CI. | ||
| // REVERT BEFORE MERGE (drop the TEMP commit to restore). | ||
| it.skip('omits maxConcurrency by default', () => { | ||
| delete process.env.ENFORCE_STRICT_CONCURRENCY; | ||
| const trigger = getWorkflowQueueTrigger(); | ||
| expect(trigger.topic).toBe('__wkf_workflow_*'); | ||
| expect('maxConcurrency' in trigger).toBe(false); | ||
| }); | ||
|
|
||
| it('sets maxConcurrency: 1 when ENFORCE_STRICT_CONCURRENCY=1', () => { | ||
| process.env.ENFORCE_STRICT_CONCURRENCY = '1'; | ||
| const trigger = getWorkflowQueueTrigger(); | ||
| expect(trigger).toMatchObject({ | ||
| topic: '__wkf_workflow_*', | ||
| maxConcurrency: 1, | ||
| }); | ||
| }); | ||
|
|
||
| // TEMP(ci-default-on): skipped while strict concurrency is forced on for CI. | ||
| // REVERT BEFORE MERGE (drop the TEMP commit to restore). | ||
| it.skip('does not set maxConcurrency for non-"1" values', () => { | ||
| process.env.ENFORCE_STRICT_CONCURRENCY = 'true'; | ||
| const trigger = getWorkflowQueueTrigger(); | ||
| expect('maxConcurrency' in trigger).toBe(false); | ||
| }); | ||
|
|
||
| it('never applies concurrency to the step trigger', () => { | ||
| process.env.ENFORCE_STRICT_CONCURRENCY = '1'; | ||
| expect('maxConcurrency' in STEP_QUEUE_TRIGGER).toBe(false); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.