Erlang Languagedirector


Flexible, fast and powerful supervisor library for Erlang processes.



  • Do not use 'count'=>infinity and element restart in your plan.
Childspec = #{id => foo
             ,start => {bar, baz, [arg1, arg2]}
             ,plan => [restart]
             ,count => infinity}.

If your process did not start after crash, director will lock and retries to restart your process infinity times ! If you are using infinity for 'count', always use {restart, MiliSeconds} in 'plan' instead of restart.

  • If you have plans like:
Childspec1 = #{id => foo
              ,start => {bar, baz}
              ,plan => [restart,restart,delete,wait,wait, {restart, 4000}]
              ,count => infinity}.

Childspec2 = #{id => foo
              ,start => {bar, baz}
              ,plan => [restart,restart,stop,wait, {restart, 20000}, restart]
              ,count => infinity}.

Childspec3 = #{id => foo
              ,start => {bar, baz}
              ,plan => [restart,restart,stop,wait, {restart, 20000}, restart]
              ,count => 0}.

Childspec4 = #{id => foo
              ,start => {bar, baz}
              ,plan => []
              ,count => infinity}.

The rest of delete element in Childspec1 and the rest of stop element in Childspec2 will never evaluate!
In Childspec3 you want to run your plan 0 times!
In ChildSpec4 you have not any plan to run infinity times!

  • When you upgrade a release using release_handler, release_handler calls supervisor:get_callback_module/1 for fetching its callback module.
    In OTP<19 get_callback_module/1 uses supervisor internal state record for giving its callback module. Our director does not know about supervisor internal state record, then supervisor:get_callback_module/1 does not work with directors.
    Good news is that in OTP>=19 supervisor:get_callback_module/1 works perfectly with directors :).
1> foo:start_link().

2> supervisor:get_callback_module(foo_sup).