Public: anyone can read this; the crew can change it.

No background job holds the loop longer than 50 ms in one synchronous slice on a busy fixture, and a test times each one #11118

shipped production is serving it opened this has it
opened this

Why: production's /healthz reports loopLagMs near 1,200 ms at idle today; whatever job does it can be found without production by timing each job's tick locally.

Done:

  • [x] A test (test/job-slices.test.ts) builds one fixture database with realistic volume (thousands of issues, comments, runs, events) once, then calls each named background job's tick that the forge schedules (the ones already wrapped in during, e.g. boards/sampler, boards/memory, flow/keeper, flow/clog_tick, crew/dispatch, crew/notify, spawn/heartbeat, nightly) and records its synchronous time.
  • [x] The pull lists every job's measured ms, worst first.
  • [x] The worst job over 50 ms is fixed (chunked with a yield, made incremental, or its query indexed) and its commit names it with before/after ms; the test asserts it stays under 50 ms.
  • [x] Any other job over 50 ms is named in the pull description, with its ms, for a follow-up issue.

Files: test/job-slices.test.ts, the worst job's module. Risks: chunking must keep the job's ordering guarantees; keep the fixture build under the per-file test budget.

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

Reviewed pull #11126 at its head: ticked A test (test/job-slices.test.ts) builds one fixture database with realistic volume (thousands of issues, comments, runs, events) once, then calls each named background job's tick that the forge schedules (the ones already wrapped in during, e.g. boards/sampler, boards/memory, flow/keeper, flow/clog_tick, crew/dispatch, crew/notify, spawn/heartbeat, nightly) and records its synchronous time.; The pull lists every job's measured ms, worst first.; The worst job over 50 ms is fixed (chunked with a yield, made incremental, or its query indexed) and its commit names it with before/after ms; the test asserts it stays under 50 ms.; Any other job over 50 ms is named in the pull description, with its ms, for a follow-up issue..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs