fix(jobs): exclude job worker ports from schema-change broadcasts#1428
Conversation
Job workers run a single isolated task and exit — they don't participate in schema-change gossip. Including them in broadcastWithAcknowledgement causes a deadlock: the broadcast waits for the job worker's ACK while the job worker's own event loop is blocked waiting for that same schema change to complete. Fix: tag ports created for JOB thread types with isJobWorker, propagate the flag via ADDED_PORT messages to peer ports, and skip those ports in broadcastWithAcknowledgement. Also improve job-start error handling to persist an ERROR status on the job record if the worker thread fails to launch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds robust error handling to the job runner, ensuring that failed jobs are correctly updated with an error status and logged. Additionally, it updates thread management to identify job workers and exclude them from broadcast acknowledgements, preventing deadlocks during schema-change gossip. There are no review comments, so we have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Reviewed; no blockers found. |
Summary
broadcastWithAcknowledgement— causing a deadlock where the broadcast waited for the job worker's ACK while that worker's event loop was itself blocked waiting for the same schema change to complete (re-entrant schema change triggered by the job operation).JOBthread types withisJobWorker, propagate the flag throughADDED_PORTmessages to all peer ports, and skip tagged ports inbroadcastWithAcknowledgement.JOBtoTHREAD_TYPESinhdbTerms.ts(previously it was onlyHTTP) and improves error handling injobRunner.tsto persist anERRORstatus on the job record if the worker thread fails to launch.Test plan
ERRORstatus on the job record🤖 Generated with Claude Code