Repository navigation
fix(ios): hold a canceled request's locks until its runner command ends #3385
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
36 changes: 36 additions & 0 deletions
36
packages/platform-apple/src/runner/runner-command-journal.ts
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,36 @@ | ||
| import type { RunnerCommand } from './runner-contract.ts'; | ||
| import type { RunnerCommandAccounting } from './runner-session-types.ts'; | ||
|
|
||
| /** | ||
| * The runner journal vocabulary, so charge settlement, status recovery, and the drain of a canceled | ||
| * command cannot disagree about what a state means. `runner-swift-settlement-fixtures.ts` pins these | ||
| * names to `RunnerCommandLifecycleState`, and the recovery wiring rows are derived from that same | ||
| * declaration, so a state the runner gains has to be ruled here before it can decide a handoff. | ||
| * | ||
| * `completed` and `failed` close an entry — from the response's `ok` in `finish`, or a thrown error in | ||
| * `fail` — so execution ended. `accepted` and `started` are written as execution opens, so they share | ||
| * one in-flight verdict. `notAccepted` is what `status` reports for an id the journal never held, | ||
| * which this daemon cannot read as terminal. | ||
| */ | ||
| const RUNNER_TERMINAL_LIFECYCLE_STATES: ReadonlySet<string> = new Set(['completed', 'failed']); | ||
| export const RUNNER_IN_FLIGHT_LIFECYCLE_STATES: ReadonlySet<string> = new Set([ | ||
| 'accepted', | ||
| 'started', | ||
| ]); | ||
|
|
||
| /** | ||
| * Discharges the abandoned charge terminal status proves landed (#2965). A status reply is served | ||
| * inline, so it is no evidence that queued work finished; this is the only place a status answer may | ||
| * settle a charge, and only the one its `statusCommandId` names. | ||
| * | ||
| * @returns whether the evidence paid a debt, or `undefined` when the state is not terminal and no | ||
| * settlement was attempted. | ||
| */ | ||
| export function settleRunnerChargeForTerminalStatus( | ||
| session: { commandCharges: RunnerCommandAccounting }, | ||
| command: Pick<RunnerCommand, 'commandId'>, | ||
| lifecycleState: string, | ||
| ): boolean | undefined { | ||
| if (!RUNNER_TERMINAL_LIFECYCLE_STATES.has(lifecycleState)) return undefined; | ||
| return session.commandCharges.settleTerminalEvidence(command.commandId); | ||
| } |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.