From 25886e4fcc6ae686d5eff43d7fd647d4cfb8dbc8 Mon Sep 17 00:00:00 2001 From: Hampus Date: Sat, 24 Oct 2026 05:36:24 +0200 Subject: [PATCH] fix(gateway): notify clients by role in the shutdown drain --- fluxer_gateway/src/gateway/gateway_cluster_handoff.erl | 2 +- fluxer_gateway/src/gateway/gateway_shutdown_drain.erl | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fluxer_gateway/src/gateway/gateway_cluster_handoff.erl b/fluxer_gateway/src/gateway/gateway_cluster_handoff.erl index dce66f55a..164a59977 100644 --- a/fluxer_gateway/src/gateway/gateway_cluster_handoff.erl +++ b/fluxer_gateway/src/gateway/gateway_cluster_handoff.erl @@ -4,7 +4,7 @@ -typing([eqwalizer]). -behaviour(gen_server). --export([start_link/0, drain_async/0, undrain/0, diagnostic_info/0]). +-export([start_link/0, drain_async/0, drain_notify_role/0, undrain/0, diagnostic_info/0]). -export([ init/1, handle_call/3, diff --git a/fluxer_gateway/src/gateway/gateway_shutdown_drain.erl b/fluxer_gateway/src/gateway/gateway_shutdown_drain.erl index 72f1fdb84..b19fe1efb 100644 --- a/fluxer_gateway/src/gateway/gateway_shutdown_drain.erl +++ b/fluxer_gateway/src/gateway/gateway_shutdown_drain.erl @@ -17,10 +17,7 @@ run() -> -spec drain() -> ok. drain() -> persistent_term:put({fluxer_gateway, draining}, true), - Result = shard_utils:safe_apply( - fun session_manager:reconnect_drain/0, - {error, unavailable} - ), - logger:info("Gateway shutdown drain: ~p", [Result]), + ok = gateway_cluster_handoff:drain_notify_role(), + logger:info("Gateway shutdown drain: notified clients"), timer:sleep(?FRAME_FLUSH_MS), ok.