Skip to content

fix(setup): use monotonic time for lock deadlines - #832

Open
627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-829-setup-config-lock-timeout
Open

627150795 wants to merge 1 commit into
openpi-dev:mainfrom
627150795:codex/issue-829-setup-config-lock-timeout

Conversation

@627150795

@627150795 627150795 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After #863 replaced per-process start-time queries with heartbeat leases, setup-config lock acquisition still used wall-clock time for its elapsed patience and hard deadlines. A system clock adjustment can shorten or extend a wait on an untrusted lock.

Value

Elapsed lock-wait budgets now use a monotonic clock, while stale-lock checks continue to compare filesystem timestamps with wall-clock time. Uncertain lock ownership still fails closed without changing the configuration.

Approach

  • Use performance.now() for the patience deadline, hard deadline, and recheck timer.
  • Keep wall-clock comparisons for lock-file modification times.
  • Add a regression that simulates normal, forward, and backward wall-clock movement while asserting the same five-second patience deadline and preserving the uncertain lock and config.
  • Narrow this PR to the deadline behavior that remains after fix(setup): use a heartbeat lease for the config lock #863; it no longer changes process-start queries.

Validation

Base: 708a44b52cb260cb6c35c25c4f5bd63ebfec369c
Final HEAD: 598f429ae266f666a959e54150042ca6f335624a

  • node --test --experimental-strip-types tests/extensions/shared/setup-config.test.ts — 47 passed, 0 failed.
  • bun run check — passed.
  • bun run test — 2,473 passed, 14 skipped, 35 failed. Thirty-four failures were Windows EPERM while creating symlink fixtures; one dependent transcript-search assertion also failed after its symlink fixture could not be created.
  • git diff --check origin/main...HEAD — passed.
  • GitHub Actions run 39017765773 — 17/17 jobs succeeded; the PR reports 18/18 checks successful on this final HEAD.

Impact

No persisted config or lock-file schema changes. Only elapsed wait timing changes; filesystem timestamp checks retain wall-clock semantics. No config mutation occurs while lock ownership is uncertain.

@github-actions github-actions Bot added the area:setup OpenPI setup, configuration, or setup documentation label Oct 14, 2026
@627150795
627150795 force-pushed the codex/issue-829-setup-config-lock-timeout branch from 2513e65 to 415f35b Compare October 14, 2026 15:29
tt-a1i
tt-a1i previously approved these changes Oct 15, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 415f35bfe3653913f133194f48cc211f79e16438 against f98d6a4737461ba8d8ee100f113b5a7c3a0001a0. Independent design and correctness passes found no blocking findings. Focused setup-config tests (36/36), bun run check, and the full macOS Node 26 suite passed; current-head CI is green. The successful-current-process identity cache preserves unknown-owner fail-closed behavior, and the wait deadline uses monotonic time. Scope remains Issue #829 item 3; no broader closure or Windows manual-smoke claim.

@627150795
627150795 force-pushed the codex/issue-829-setup-config-lock-timeout branch from 415f35b to 598f429 Compare October 17, 2026 08:32
@627150795 627150795 changed the title fix(setup): prevent Windows lock timeout on PID reuse fix(setup): use monotonic time for lock deadlines Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:setup OpenPI setup, configuration, or setup documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants