Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ihp/IHP/Job/Runner.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ jobWorkerFetchAndRunLoop JobWorkerArgs { .. } = do
Left exception -> do
Log.error ("Job worker: Failed to fetch next job: " <> tshow exception)
Concurrent.threadDelay 1000000 -- 1s backoff to avoid tight error loops
runJobLoop -- retry after transient error

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop retry loop when worker shutdown is requested

Re-entering runJobLoop after every fetch error means an active worker never terminates while the database keeps failing, so the dispatcher’s Stop path can block indefinitely waiting for activeCount == 0 during shutdown. This is a regression from the previous behavior (worker exited on fetch failure): with subscriptions/poller already stopped, there is no new work to drain, but this retry loop keeps the worker alive forever unless a second forced cancellation signal is sent.

Useful? React with 👍 / 👎.

Right (Just job) -> do
Log.info ("Starting job: " <> tshow job)

Expand Down