worker: /health reports ok for a stopped or wedged worker (revisits #138)
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Read apps/worker/src/index.ts and inspect Worker.stop() and Worker.poll(), especially how running and lastPollTime are updated around polling and job batches. Exercise /health with a stopped worker, a wedged poll, and a healthy long-running job; done means unhealthy states are rejected without causing a healthy in-progress batch to fail.
Written by the indexing model from the issue text.
Description
Found during the review of #180; the fix attempted there was reverted because it broke the healthy path (see below).
apps/worker/src/index.ts returns 200 {status:'ok', ...health} whenever the worker object exists. It never consults running or lastPollTime, so:
- Stopped worker reports healthy.
Worker.stop()setsrunning = falsewithout exiting the process — including from Worker's own signal handlers — leaving/healthserving200 {"status":"ok","running":false}. - Wedged poll loop reports healthy.
Worker.poll()catches every error and reschedules. A poll blocked on a hung database call leavesrunning: trueandlastPollTimefrozen, and/healthreturns 200 forever while the queue backs up.
Important constraint for whoever picks this up: the naive fix (503 when lastPollTime is stale) breaks the healthy path. Worker.poll() stamps lastPollTime at the top and then awaits the job batch, so the timestamp legitimately freezes for the whole batch — up to the 300s jobTimeouts. A 60s staleness bound therefore 503s a perfectly healthy worker mid-job and lets the container healthcheck kill it. That regression was caught in review and is why this is not already fixed.
Any real fix probably needs Worker to stamp when it schedules the next poll rather than when one begins, or to gate the stalled verdict on activeJobCount === 0.
- Dominant language
- TypeScript
- Stars
- 12
- Forks
- 6
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 7
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CopilotKit/outpost
-
area: docs area: security roadmap: now
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
CopilotKit/outpost#277 ·
Maintainers usually reply within 4 days
-
area: infrastructure roadmap roadmap: later
Difficulty 1/5 Under an hour Newbie friendliness 74/100
CopilotKit/outpost#179 ·
Maintainers usually reply within 4 days
-
area: ai roadmap roadmap: now
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/outpost#145 ·
Maintainers usually reply within 4 days
-
area: integrations priority: low roadmap roadmap: later
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
CopilotKit/outpost#124 · 3 comments ·
Maintainers usually reply within 4 days
-
area: integrations priority: low roadmap roadmap: later
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
CopilotKit/outpost#123 · 2 comments ·
Maintainers usually reply within 4 days
All issues in CopilotKit/outpost
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
cline/mcp-marketplace#2932 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
lingdojo/kana-dojo#32188 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Portkey-AI/gateway#1844 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
rjsf-team/react-jsonschema-form#5495 ·
Maintainers usually reply within 2 days