Skip to content

fix: prevent false extension timeouts after suspension - #8380

Merged
kunchenguid merged 2 commits into
kunchenguid:mainfrom
WTF-KRP:fm/up-fm-8026
Nov 12, 2026
Merged

kunchenguid merged 2 commits into
kunchenguid:mainfrom
WTF-KRP:fm/up-fm-8026

Conversation

@WTF-Am-ID

@WTF-Am-ID WTF-Am-ID commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8026

A deadline that expired while the host was suspended could kill a healthy extension as soon as the machine resumed.

  • Added one shared deadline state for invocation, handshake, launch-readiness, and launch-release waits.
    Clearly late checks now grant one bounded 1-second grace, while awake stalls retain their configured bound.
  • Added the bound, actual operation, configured duration, elapsed time, overrun, and granted grace to timeout diagnostics.
    Repeated timeout captures retain their first complete diagnostic record while ignoring changing elapsed and overrun samples.
  • Added real SIGSTOP/SIGCONT regression coverage and updated the deadline and evidence documentation.

Verification

No-mistakes completed review, live validation, documentation, and pinned lint checks.
The live checks passed on d0f69a2eb91047b6ce8272fdaf8d56d99cc016ab, followed by a documentation-only clarification.

  • FM_TEST_SKIP_ORPHAN_REAP=1 FM_EXTENSION_BINDING_SEGMENT=deadlines bash bin/fm-test-run.sh tests/fm-extension-binding.test.sh passed.
    Invocation, handshake, readiness, and release survived suspension.
    Awake stalls timed out without grace, and suspended stalls received one bounded grace.
    Closure-test output.
  • A separate double-suspension check confirmed that grace cannot renew.
    Output.
  • Real registration and polling checks confirmed that repeated timeouts coalesce per bound, distinct bounds remain separate, and successful adapter results retain separate captures.
    Capture evidence.
  • The early-bind, early-handshake, matrix-runtime, and lifecycle-host-errors segments passed.
    The unrelated foreign-owner fixture skipped because chown privilege was unavailable.
    Commands, revisions, and exit statuses.
  • The suspension checks failed against base product files at a02b089835a114844cc53d0429570155dfe4ef3a.
    Baseline output.

Review noted a possible pre-freeze timing flake in the regression under CPU contention.
It did not reproduce in the validation runs.
The bounded design still permits timeout when a callback is less than 2 seconds late or a child needs more than the 1-second grace after resume.

Updates from git push no-mistakes

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with no new actionable issues found.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Clarify timeout e..." · Reviewed by Greptile

@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 12, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @WTF-Am-ID for picking up #8026. On 86bee765, the invocation, handshake, launch-ready and launch-release deadlines share one deadline object. A check that arrives more than 2 s late gets one 1 s grace that can't renew, an awake stall keeps its configured bound, and timeout evidence now names the bound, operation, timeout_ms, elapsed, overrun and granted grace. Repeated timeout captures for the same bound reuse the first capture instead of minting a new one on every timing sample. The SIGSTOP/SIGCONT regression passes at d0f69a2e and fails against base a02b0898. The double-suspension check shows the grace can't renew. The only change since is a docs commit. The no-mistakes attestation binds this head with no skipped steps, Greptile is 5/5 with no open threads, the quick checks pass, and the branch is current with main. Fixes #8026 is right (open, ready-for-pr). Contract-class: restore, the same shape we scoped on #8026. VISION aligns with every rule.

I've queued the full suite. Nothing is waiting on you.

@kunchenguid
kunchenguid merged commit 488b232 into kunchenguid:main Nov 12, 2026
35 of 36 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @WTF-Am-ID — really appreciate you taking the time on this.

ayrton-saunders added a commit to ayrton-saunders/firstmate that referenced this pull request Nov 14, 2026
) (#46)

* fix: give suspended extension deadlines one bounded grace

* no-mistakes(document): Clarify timeout evidence identity

(cherry picked from commit 488b232)

Co-authored-by: WTF Am I Doing ? <WTF.AM.ID@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension host deadlines count system sleep, so a poll in flight across a sleep is killed at wake and recorded as code=timeout

2 participants