Parent: GH-2219
re-queuing without a worker just recreates the orphan). (c) Change Start() to accept context.Context and launch a runStaleRecoveryLoop goroutine that ticks every StaleRecoveryInterval. (d) Add summary log line "stale recovery complete, reset N tasks" on every pass (even when 0) for diagnosability of the GH-2213 survival mystery. (e) Update Start() callers if signature changes. (f) Add tests: TestRecoverStaleTasks_QueuedAndRunning, TestRecoverStaleTasks_RespectsThresholds, TestRunStaleRecoveryLoop_Periodic, TestQueueTask_AfterRecovery in internal/executor/dispatcher_test.go.
Parent: GH-2219
re-queuing without a worker just recreates the orphan). (c) Change
Start()to acceptcontext.Contextand launch arunStaleRecoveryLoopgoroutine that ticks everyStaleRecoveryInterval. (d) Add summary log line"stale recovery complete, reset N tasks"on every pass (even when 0) for diagnosability of the GH-2213 survival mystery. (e) UpdateStart()callers if signature changes. (f) Add tests:TestRecoverStaleTasks_QueuedAndRunning,TestRecoverStaleTasks_RespectsThresholds,TestRunStaleRecoveryLoop_Periodic,TestQueueTask_AfterRecoveryininternal/executor/dispatcher_test.go.