Repository navigation
fix(gate): take the host validation lock for heavy gates - #3900
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pass the environment to acquireValidationLock so nested-owner detection and the gate runner read the same variables, skip the lock on unsupported hosts, cover signal cancellation, and tighten the lock documentation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
|
The locked branch of Not blocking, and you can take or leave these: Would it be simpler to keep the This review covers cdc78ec. I read the change but did not run the new tests or your locked |
Move the publish, activate, finish protocol and the signal-to-exit-code mapping into scripts/check-affected so validation runs and heavy gates share one owner. Restore the testing and pull-request rules that the previous revision dropped, and cover a signal that arrives while the locked command is running. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Addressed in 1628711 (also merged Blocking: one owner for the lock protocol
Non-blocking
|
|
This PR is ready at 1628711. The findings from the earlier review at cdc78ec (#3900 (comment)) are fixed, and I found nothing new in the code. I read the new host-lock and gate tests but did not run them locally. CI shows 18 checks with none failing at this head. There are no conflicts. Not blocking, and you can take or leave it: the PR body Validation section still cites cdc78ec, 8 files, 6 tests and removed sentences in testing.md and pull-requests.md, which the later commits reverted. It would help to update it to 1628711, 11 files, 7 gate tests plus the runLockedCommand test, and to re-run |
|
Brings in #3892, which fixes the iOS simulator logs stop hang. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * origin/main: perf(ios): read each resolved text input through one snapshot (#3882) fix(gate): take the host validation lock for heavy gates (#3900) fix(logs): keep an early iOS simulator logs stop from hanging the session (#3892) fix(apple): clean the runner derived path the runner uses (#3897) test(provider-scenarios): open deadline scenarios without the test IME (#3903) test(host-kit): stub os.homedir for the exec-trace late-close test (#3898)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ps/ios-suite: fix(perf): stop the log stream right after it starts perf(ios): read each resolved text input through one snapshot (#3882) fix(gate): take the host validation lock for heavy gates (#3900) fix(logs): keep an early iOS simulator logs stop from hanging the session (#3892) fix(apple): clean the runner derived path the runner uses (#3897) test(provider-scenarios): open deadline scenarios without the test IME (#3903) test(host-kit): stub os.homedir for the exec-trace late-close test (#3898)
Summary
pnpm gate unit-ci(and other whole-repo gates) did not take the host validation lock. Four worktrees ran it at once on a 12-core Mac; load reached ~1000 and every run hit false 5 s test timeouts.pnpm gate <id>now runs heavy gates under the same lock thatcheck:affected --runandcheckhold: same owner, waiter output, dead-owner reclaim, and 2-hour timeout. No second lock.heavyGateinCHECK_CATALOG,hostLocked):unit,unit-ci,provider-integration(whole-repo suites),fuzz-parsers,mutation,mutation-affected,concurrency-torture(many workers/processes). Cheap gates stay unlocked.AGENT_DEVICE_VALIDATION_PARENTand runs directly, so nothing deadlocks.GITHUB_ACTIONS=trueruns the gate unlocked (single-tenant runners). Unsupported hosts (Windows) also run unlocked.acquireValidationLocktakes an optionalenv, so nested-owner detection reads the same environment as the gate runner.docs/agents/testing.mdname the locked gates. To stay inside the guidance byte budgets, I removed a few duplicate sentences intesting.md/pull-requests.md.The lock protocol (publish, activate, finish) and the signal-to-exit-code mapping have one owner in
scripts/check-affected:runLockedCommandandabortOnTerminationSignal. Validation runs and gates both use them.No linked issue.
Validation
pnpm check:affected --run --head 1628711576exits 0 withexactCommit: true(all runnable checks passed, including lint on the mergedorigin/main).scripts/gate/host-locked.test.ts(7 tests) andhost-lock.test.ts(4 tests) pass. They cover waiting, the exit code, nested no-deadlock, unlocked cheap and GitHub gates, a signal while waiting (143), a signal while the locked command runs (143, command group gone, lock andactive.jsonremoved), andrunLockedCommandpublishing and clearing ownership.pnpm gate unit-ciwaited behind another owner, then ran through the sharedrunLockedCommandpath: exit 0, 16977 tests passed, lock released.🤖 Generated with Claude Code