From f5afde4bb41784e09069cdfc97b1307f53a6acc1 Mon Sep 17 00:00:00 2001 From: Parker Selbert Date: Tue, 14 Sep 2021 08:23:41 -0500 Subject: [PATCH] Change queue supervisor strategy to :one_for_all 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 --- lib/oban/queue/supervisor.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oban/queue/supervisor.ex b/lib/oban/queue/supervisor.ex index 331d9ff1..e6e720bf 100644 --- a/lib/oban/queue/supervisor.ex +++ b/lib/oban/queue/supervisor.ex @@ -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