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

Returns the pid of the phoenix endpoint supervisor

Inserts the instruction before the point of no return.

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

Link to this function

arguments(instructions, config)

View Source
@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

Link to this function

call_this(arguments \\ [])

View Source
@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.

Link to this function

endpoint(otp_application_name)

View Source
@spec endpoint(otp_application_name :: atom()) :: pid()

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.

Link to this function

modify_relup(instructions, config)

View Source

Callback implementation for Edeliver.Relup.Instruction.modify_relup/2.

Link to this function

ranch_acceptors(ranch_acceptors_sup)

View Source
@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.

Link to this function

ranch_acceptors_sup(ranch_listener_sup)

View Source
@spec ranch_acceptors_sup(ranch_listener_sup :: pid()) :: pid()

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.

Link to this function

ranch_listener_sup(otp_application_name)

View Source
@spec ranch_listener_sup(otp_application_name :: atom()) :: pid()

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.

Link to this function

run(otp_application_name)

View Source
@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.