View Source Edeliver.Relup.PhoenixModification (edeliver v1.9.2)
This module provides default modifications of the relup instructions for phoenix apps.
It performs the following steps:
Checking whether the upgrade is possible
- by checking whether there are processes running old code (from a previous upgrade)
- by checking whether the ranch acceptor processes can be found
- by checking whether ranch connection processes can be found
or canceling the upgrade if one of the checks fails.
Preparing the upgrade
- by suspending all ranch acceptors to avoid accepting new connections / requests during the hot code upgrade
- by suspending phoenix channels
- by waiting a short time until running requests are finished and notifying the remaining that an upgrades starts (this allows to rerun failed requests later)
Executing the upgrade
- by using
:soft_purge
instead of:brutal_purge
when loading new code - by suspending all processes running code of changed modules
- by calling
code_change
at this processes - by resuming that processes
- by using
Finishing the upgrade
- by rerunning requests that failed during the upgrade
- by resuming all phoenix channels
- by resuming all ranch acceptors to continue accepting new connections
Link to this section Summary
Functions
Callback implementation for Edeliver.Relup.Modification.modify_relup/2
.
Returns the priority Edeliver.Relup.Modification.priority_default/0
+1
.
Returns true if the current project is a phoenix project
Link to this section Functions
Callback implementation for Edeliver.Relup.Modification.modify_relup/2
.
@spec priority() :: non_neg_integer()
Returns the priority Edeliver.Relup.Modification.priority_default/0
+1
.
Unless the module is set by the RELUP_MODIFICATION_MODULE
env or
the --relup-mod=
command line option the module with the highest priority
is used (which is also usable).
@spec usable?(Edeliver.Relup.Config.t()) :: boolean()
@spec usable?(Edeliver.Relup.Config.t()) :: boolean()
Returns true if the current project is a phoenix project