edeliver_fork v1.4.5 Edeliver.Relup.Instructions.FinishRunningRequests

Notify request processes that a release upgrade starts.

This upgrade instruction waits a short time until current requests finished and notifies the remaining, that a code upgrade will appear. If a phoenix version is used which supports the upgrade notification feature, the remaining requests that did not finish but failed durining the upgrade will be replayed with the original request when the code upgrade is done. This instruction should be used in conjunction with and after the

Edeliver.Relup.Instructions.SuspendRanchAcceptors

instruction which avoids that new requets are accepted during the upgrade.

To make sure that the http request connections can be found on the node, use this instruction after the

Edeliver.Relup.Instructions.CheckRanchConnections

instruction which will abort the upgrade if the http request connections accepted by ranch cannot be found in the supervision tree.

Summary

Functions

Returns name of the application and the timeout in ms to wait until running requests finish

Waits until the list of processes terminated

Calls the run/1 function of this module

Appends this instruction to the instructions after the “point of no return”

Sends the given event to all processes representing http requests

Waits timeout milliseconds until current http requests finished

Functions

arguments(instructions, config)

Specs

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 name of the application and the timeout in ms to wait until running requests finish.

These values taken as argument for the run/1 function

bulk_wait_for_termination(processes, timeout)

Specs

bulk_wait_for_termination(processes :: [pid], timeout :: non_neg_integer) :: [pid :: pid]

Waits until the list of processes terminated.

Waits up to timeout ms and the returns the process ids of the processes which are still running

call_this(arguments \\ [])

Specs

call_this(arguments :: [term]) ::
  Instruction.instruction |
  Instruction.instructions

Calls the run/1 function of this module

from the relup file during hot code upgrade

dependencies()

Specs

dependencies :: [instruction_module :: atom]
dependencies :: [Edeliver.Relup.Instructions.CheckRanchAcceptors]

This module depends on the Edeliver.Relup.Instructions.CheckRanchAcceptors and the Edeliver.Relup.Instructions.CheckRanchConnections module

which must be loaded before this instruction for upgrades and unload after this instruction for downgrades.

insert_where()

Specs

insert_where :: Instruction.insert_fun

Appends this instruction to the instructions after the “point of no return”

but before any instruction which loads or unloads new code, (re-)starts or stops any running processes, or (re-)starts or stops any application or the emulator.

modify_relup(instructions, config)
notify_running_requests(list, event)

Specs

notify_running_requests([pid], event :: term) :: :ok

Sends the given event to all processes representing http requests

run(arg)

Specs

run({otp_application_name :: atom, timeout :: non_neg_integer}) :: :ok

Waits timeout milliseconds until current http requests finished

and notifies remaining request processes that a code upgrad is running and new code will be loaded. This enables phoenix to rerun requests which failed during code loading.