View Source Edeliver.Relup.Instructions.CheckRanchAcceptors (edeliver v1.9.2)
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 inserted 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
Callback implementation for Edeliver.Relup.RunnableInstruction.dependencies/0
.
Returns the pid of the phoenix endpoint supervisor
Inserts the instruction before the point of no return.
Callback implementation for Edeliver.Relup.Instruction.modify_relup/2
.
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
@spec arguments( %Edeliver.Relup.Instructions{ changed_modules: term(), down_instructions: term(), down_version: term(), up_instructions: term(), up_version: term() }, Edeliver.Relup.Config.t() ) :: term()
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
@spec call_this(arguments :: [term()]) :: Instruction.instruction() | Instruction.instructions()
Calls the run/1
function of this module
from the relup file during hot code upgrade
@spec dependencies() :: [instruction_module :: atom()]
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
.
@spec insert_where() :: Instruction.insert_fun()
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.
Callback implementation for Edeliver.Relup.Instruction.modify_relup/2
.
@spec 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.
@spec run(otp_application_name :: atom()) :: :ok
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.