Extend MCP idle timeout to one hour#328
Conversation
There was a problem hiding this comment.
💡 Codex Review
Lines 967 to 968 in 9a70fb4
The watchdog now sleeps only at the end of the loop, but if (last == 0) continue; bypasses that sleep. This introduces a hot spin path that repeatedly polls and reloads atomics with no delay until last_activity is initialized, which can peg a core if MCP startup is delayed or refactored to initialize activity later. Add a sleep in this branch (or initialize last_activity before starting the watchdog) to keep the 1-second polling behavior.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
Speed comparison for timeout changeCompared current #328 build ( GitHub bench-regressionOfficial PR bench artifact passed with all rows
Full artifact had every benchmark row within the 10% / 50,000ns gate. Local MCP lifecycle smoke20 local runs per binary, using the installed binaries directly:
The lifecycle numbers are effectively unchanged for normal MCP EOF shutdown. The behavioral change in #328 is the policy: idle timeout is now 1 hour, while the dead-client watchdog poll remains independent and is bounded to 1 second. Remote wiki callsBoth current and previous builds successfully handled |
Summary
Verification