Skip to content

Commit

Permalink
Update lib/phoenix/tracker.ex
Browse files Browse the repository at this point in the history
Co-authored-by: José Valim <[email protected]>
  • Loading branch information
nathanl and josevalim authored Sep 27, 2024
1 parent a44e701 commit 218b793
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/phoenix/tracker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ defmodule Phoenix.Tracker do
## Application Shutdown
A tracker does not automatically replicate its state across the cluster as it
shuts down. This means that your supervision tree shuts down normally - as it
does when you call `System.stop()` or the BEAM receives a `SIGTERM` - any
presences that the local tracker instance has will continue to be seen as
present by other trackers in the cluster until the `:down_period` for the
instance has passed.
When a tracker shuts down, the other nodes do not assume it has been gone
for good. After all, in a distributed system, it is impossible to know if something
is just temporarily unavailable or if it has crashed.
For this reason, when you call `System.stop()` or the Erlang VM receives a
`SIGTERM` - any presences that the local tracker instance has will continue to
be seen as present by other trackers in the cluster until the `:down_period`
for the instance has passed.
If you want a normal shutdown to immediately cause other nodes to see that
tracker's presences as leaving, pass `permdown_on_shutdown: true`. On the
Expand Down

0 comments on commit 218b793

Please sign in to comment.