edeliver_fork v1.4.6 Edeliver.Relup.Instructions.CheckRanchAcceptors
This upgrade instruction checks whether the ranch acceptors can be found.
This instruction will cause the upgrade to be canceled if the ranch acceptors cannot be found and because it is insterted before the “point of no return” it will run twice, once when checking the relup and once when executing the relup.
Link to this section Summary
Functions
Returns the name of the application
Calls the run/1
function of this module
Returns a list of module names which implement the behaviour Edeliver.Relup.RunnableInstruction
Returns the pid of the phoenix endpoint supervisor
Inserts the instruction before the point of no return
Modifies the relup file
Gets the supervisor child ids of the ranch socket accecptors
Gets the pid of the supervisor which supervises the ranch socket acceptors
Gets the pid of the ranch listener supervisor
Checks whether the ranch acceptors can be found
Link to this section Functions
Returns the name of the application.
This name is taken as argument for the run/1
function and is required to
access the acceptor processes through the supervision tree
call_this(arguments :: [term()]) :: Instruction.instruction() | Instruction.instructions()
Calls the run/1
function of this module
from the relup file during hot code upgrade
Returns a list of module names which implement the behaviour Edeliver.Relup.RunnableInstruction
and are used / referenced by this runnable instruction. These modules must be loaded before this instruction is executed for upgrades and unloaded after this instruction for downgrades. Default is an empty list.
Callback implementation for Edeliver.Relup.RunnableInstruction.dependencies/0
.
Returns the pid of the phoenix endpoint supervisor
or throws and logs an error if it cannot be found. It supervises the
Phoenix.Endpoint.Server
which supervises the connections and acceptors,
Phoenix.Config
and the phoenix pubsub supervisor, e.g. Phoenix.PubSub.PG2
.
Inserts the instruction before the point of no return.
This causes the release handler to abort the upgrade
already when running :release_handler.check_install_release/1
if this instruction fails.
Modifies the relup file.
Modifies the relup
file which will be used to upgrade (or downgrade) from one version to another
by inserting, removing, or shifting appup instructions.
See Edeliver.Relup.InsertInstruction
and Edeliver.Relup.ShiftInstruction
for useful helpers to
insert / position the instructions and Edeliver.Relup.RunnableInstruction
to execute custom code
during the upgrade.
Callback implementation for Edeliver.Relup.Instruction.modify_relup/2
.
ranch_acceptors(ranch_acceptors_sup :: pid()) :: [:supervisor.child_id()]
Gets the supervisor child ids of the ranch socket accecptors
(ranch_acceptor
) from the ranch acceptor supervisor or throws
and logs an error if the acceptors cannot be found.
Gets the pid of the supervisor which supervises the ranch socket acceptors.
If it cannot be found as child of the given ranch listener supervisor it throws and logs an error.
Gets the pid of the ranch listener supervisor
(:ranch_listener_sup
) which supervises the ranch acceptors supervisor
(:ranch_acceptors_sup
) and the connections supervisor (:ranch_conns_sup
).
It throws and logs an error if they cannot be found in the supervison
tree of the application.
Checks whether the ranch acceptors can be found.
If not the upgrade will be canceled. This function runs twice because it is executed before the “point of no return”, once when checking the relup and once when executing the relup.