Log when jobs don't finish executing within :shutdown_grace_period
#1076
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If jobs take longer than
:shutdown_grace_period
(by default 15 seconds) then they are brutally killed. Log a message when this occurs. The message looks like:This is important because the majority of the time in a running you usually want your jobs to finish within the
:shutdown_grace_period
and with this new log message it is now easier to detect when that doesn't happen and which jobs were affected which will allow developers to then improve those jobs so that they finish in time (e.g. by splitting a job into multiple units of work).I pass through the
conf.name
toOban.Queue.Watchman
so that it is able to check the appropriate queue status (which is especially important in the tests). I'm not in love withconf_name
but I went with it becausename
was already taken. As an aside I think the typespec forname
is incorrect, it is currentlymodule()
but it is actually receiving a via tuple like{:via, Registry, {Oban.Registry, {Oban, {:producer, "alpha"}}}}
I've added minimal test updates 9enough to verify the new behavior), if this PR looks good then I can make additional updates if needed.