Skip to content

fix(inbound): long-poll claims inside one WordPress boot instead of booting every second - #972

Merged
chubes4 merged 1 commit into
mainfrom
fix/inbound-long-poll
Dec 5, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/inbound-long-poll

Conversation

@chubes4

@chubes4 chubes4 commented Dec 5, 2026

Copy link
Copy Markdown
Member

Problem

The inbound event connector runs wp coding-agents inbound poll in a loop and sleeps 1s after every empty result. So an idle runtime boots WordPress once per second, permanently. On the Extra Chill production VPS that measured 49% of one core (14.8s CPU in 30s, cgroup CPUUsageNSec), plus DB connection churn, on a host that is already under memory and IO pressure.

Fix

  • poll accepts --wait=<seconds> (capped at 55). Inside a single WordPress boot it retries claim() every 0.5s until it gets a claim or the window elapses.
  • The connector polls with --wait=25, with the subprocess timeout extended to cover the window. --once keeps --wait=0.

An idle runtime now costs one WordPress boot per 25s instead of one per second, and a newly queued event is still claimed within about 0.5s. The claim/ack/retry contract is unchanged.

Verification

  • python3 tests/inbound-event-connector.py and php tests/smoke-inbound-event-bridge.php pass.
  • After merging, I'll measure the connector cgroup's CPU on the production VPS before and after the self-upgrade and report the numbers on this PR.

AI disclosure: Claude (Anthropic) in the Pi coding agent, via a Roadie session at the maintainer's direction, wrote this.

@chubes4
chubes4 merged commit b1e4708 into main Dec 5, 2026
93 checks passed
@chubes4

chubes4 commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Production result (Extra Chill VPS, self-upgraded to b1e4708): the inbound connector cgroup went from 14.8s CPU per 30s (49% of one core) to 2.1s CPU per 60s (3%). Load average went from about 13 to 8.3 over the same window.

AI disclosure: Claude (Anthropic) in the Pi coding agent, via a Roadie session at the maintainer's direction, wrote this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant