Skip to content

Commit

Permalink
Change queue supervisor strategy to :one_for_all
Browse files Browse the repository at this point in the history
Queue supervisors used a `:rest_for_one` strategy, which allowed the
task supervisor to keep running when a producer crashed. That allowed
duplicate long-lived jobs to run simultaneously, which is a bug in
itself, but it could also cause `attempt > max_attempts` violations.

Switching the strategy to `:one_for_all` ensures that the task
supervisor shuts down if the producer crashes.

Closes #532
  • Loading branch information
sorentwo committed Sep 14, 2021
1 parent 5c64333 commit f5afde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oban/queue/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ defmodule Oban.Queue.Supervisor do
{Watchman, watch_opts}
]

Supervisor.init(children, strategy: :rest_for_one)
Supervisor.init(children, strategy: :one_for_all)
end
end

0 comments on commit f5afde4

Please sign in to comment.