From 56b724b5a461e298bbb432f89fdf3746f9a5908d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 5 Aug 2026 08:32:05 -0500 Subject: [PATCH] fix: catch sandbox pool exits in analyze_all background Task The ANALYZE queries run via Task.Supervised which doesn't hold sandbox ownership. rescue only catches exceptions; sandbox-pool checkout failures come as exit signals. Add catch :exit so the Task logs a warning instead of crashing. --- lib/microwaveprop/weather.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/microwaveprop/weather.ex b/lib/microwaveprop/weather.ex index cca46ee3..7f273cd4 100644 --- a/lib/microwaveprop/weather.ex +++ b/lib/microwaveprop/weather.ex @@ -197,6 +197,9 @@ defmodule Microwaveprop.Weather do Logger.info("Weather.analyze_all: ANALYZE #{t} done in #{elapsed}ms") rescue e -> Logger.warning("Weather.analyze_all: ANALYZE #{t} failed: #{inspect(e)}") + catch + :exit, reason -> + Logger.warning("Weather.analyze_all: ANALYZE #{t} sandbox exit: #{inspect(reason)}") end end)