View Source Edeliver.Relup.Instructions.FinishRunningRequests (edeliver v1.9.2)

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 during 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.

Link to this section 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

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 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

Link to this function

bulk_wait_for_termination(processes, timeout)

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

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()]
@spec 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.

@spec 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.

Link to this function

modify_relup(instructions, config)

View Source

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

Link to this function

notify_running_requests(list, event)

View Source
@spec notify_running_requests([pid()], event :: term()) :: :ok

Sends the given event to all processes representing http requests

@spec 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.