edeliver_fork v1.4.5 Edeliver.Relup.Instructions.CheckProcessesRunningOldCode

Cancels the upgrade if there are processes running old code

from previous upgrades. This upgrade instruction checks whether any of the modules that will be (re)loaded during upgrade has old code. If any of them has old code it will throw an error and abort the release upgrade. This prevents crashing and restarting the node during the live upgrade. This instruction is insterted before the “point of no return” which causes it to run twice, once when checking the relup and once when executing the relup.

Summary

Functions

Returns the modules which will be loaded during the upgrade

Calls the run/1 function of this module

Inserts the instruction before the point of no return

Checks whether the modules passed as argument have old code

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 the modules which will be loaded during the upgrade.

These modules are taken as argument for the run/1 function and only these modules are checked whether they run old code. Modules which will not be updated during the upgrade does not affect the upgrade process even if they run old code. The modules to check are take from the load_object_code instructions.

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]
insert_where()

Specs

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.

modify_relup(instructions, config)
run(modules)

Checks whether the modules passed as argument have old code.

These modules are the modules which will be upgraded. 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.