Repository navigation
refactor(kernel): track held execution locks in keyed-lock - #3879
Conversation
Size Report
Startup median (7 runs, lower is better):
|
The kernel keyed lock now answers which locks an async context holds, including locks a request retains partway through, instead of a second registry in request-execution-locks. - Lock scopes form a chain with live parents, so a lock a holder scope takes later is visible to every scope nested in it. - `withKeyedLockHolder` runs a task that can `hold` locks until it ends; `heldKeyedLockKeys` lists the keys the current context holds. - Request execution locks use them: a held key re-enters, and the same-Mac rule (ADR 0035) is one check. The enclosing-request store, the held set, and the two re-entry special cases are gone. - A nested request whose initial key its parent retained now re-enters it; before, it waited on its own parent. - The close-refusal test builds its error from the production platform refusal over a stubbed app list. Closes #3876. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9e2ad9b to
e5813a1
Compare
|
Closing and reopening to re-run CI against the new base: the Size job of the retarget push measured the deleted stack base |
|
|
This PR is ready at e5813a1. Not blocking, and you can take or leave these: the pending-hold tracking in packages/kernel/src/keyed-lock.ts only matters if work runs concurrently inside one request, and on the routes I traced the device is retained before the next step starts, so drop it or name a router-level caller in a test. The re-entry fix is covered at the createRequestExecutionLocks seam in request-execution-locks.test.ts but not through the replay router, so a later same-device step in the dynamic-selection replay test would close that gap. heldKeyedLockKeys could be generic over the key type to avoid the string[] cast in request-execution-locks.ts. The ended-holder test matches on error message text. Bundle Size failed only because it could not read the deleted base tree 7519086, and the Smoke Tests, Repo Guards and Coverage runs were cancelled, not failed. The diff touches no bundling or packaging inputs, so the failures look unrelated. There are no conflicts. This was a read-only review, so I ran no tests. I also could not check the patch-id match with 9e2ad9b or the live two-app run at that SHA, because that object is not in my clone. Before merge, CI needs to go green on e5813a1 after the reopen. |
* origin/main: feat(test-app): add a Bluesky-depth heavy feed screen (#3884) fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
* origin/main: fix(android): read a child that vanished mid-read as gone (#3901) feat(ios): route iPad Simulator snapshots through the host AX bridge (#3895) Prepare shared resource ownership and selection for #3325 (#3887) refactor(kernel): track held execution locks in keyed-lock (#3879) perf(ios): ask a ready runner about surface hosts before spawning probes (#3877) fix(ios): keep the bridge while a surface host only lingers (#3873) perf(ios): synthesize taps on resolved in-app back controls (#3880) fix(macos): open a running app by its own path instead of its bundle id (#3889) fix(macos): accept mixed-case bundle ids in open (#3867) fix(macos-helper): scroll SwiftUI forms whose rows are scroll-area children (#3888)
Summary
Follow-up to #3323 (merged as
c8b944c). Replayed from its stack ontomainwith an identical patch (samegit patch-id).The kernel keyed lock now answers which execution locks a context holds, including locks taken partway through a request. Request locks keep no registry of their own.
keyed-lock.ts:withKeyedLockHoldercanholdlocks until its task ends.heldKeyedLockKeyslists held keys, including keys still being taken.request-execution-locks.tsapplies the same-Mac rule (ADR 0035) as one check; its registry and re-entry special cases are gone.5 files. Closes #3876.
Validation
Head
e5813a1d02bf8c9066381f576c1aacdf9251661d, on mainc8b944c.check:affected --run --head <head>: passed,run-jL09Mn,exactCommit: true, 4,523 related tests.9e2ad9bon7519086:run-KLsDWfpassed (12,421 related tests); three independent review rounds found nothing blocking; and a native live run passed, with two apps in parallel in one daemon, conflicts and close scope held, and no claims left. These are attributed to9e2ad9b; the patch is unchanged.🤖 Generated with Claude Code