Skip to content

Prevent federation links from restarting during node shutdown (backport #15258)#15264

Merged
michaelklishin merged 4 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15258
Jan 14, 2026
Merged

Prevent federation links from restarting during node shutdown (backport #15258)#15264
michaelklishin merged 4 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15258

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Jan 14, 2026

or plugin shutdown, for that matter.

With this guardrail in place, nodes with hundreds or thousands of federation links will avoid potentially significant shutdown delays that have to do with
links being restarted while the node as a whole is preparing to shut down.

This state is node-local, as is the shutdown state, so this will not prevent links migrating between nodes (under mirrored_supervisor) from starting.

Per discussion with @dcorbacho @ansd.

Note that this PR cannot be backported exactly to v4.1.x and earlier branches. The federation plugin split in main first shipped in 4.2.0.


This is an automatic backport of pull request #15258 done by Mergify.

or plugin shutdown, for that matter.

With this guardrail in place, nodes with hundreds or
thousands of federation links will avoid potentially
significant shutdown delays that have to do with
links being restarted while the node as a whole is
preparing to shut down.

Per discussion with @dcorbacho @ansd.

(cherry picked from commit adc25bb)
This avoids a classic deadlock in Erlang: when
an application_controller (AC) invokes a callback,
such as pre_stop/1, the function invoked cannot
use any OTP functions that would ultimately require
an AC response.

application:set_env/2 is one of such functions,
so with this commit we switch to a persistent term.

(cherry picked from commit a8347b2)
(cherry picked from commit 80c8d7b)
@michaelklishin michaelklishin added this to the 4.2.3 milestone Jan 14, 2026
@michaelklishin michaelklishin merged commit a52e5c5 into v4.2.x Jan 14, 2026
858 of 861 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15258 branch January 14, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant