diff options
author | juhlig <[email protected]> | 2020-02-27 11:55:46 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-03-16 12:11:55 +0100 |
commit | 3ff117e9ab17488662c7ef75392e3afa62838028 (patch) | |
tree | 5ae2c1581a6898f73f765f716988bcc68759ea08 | |
parent | 13074a6a7cbdfc19eb18f00f8c99c2481e0893b1 (diff) | |
download | ranch-3ff117e9ab17488662c7ef75392e3afa62838028.tar.gz ranch-3ff117e9ab17488662c7ef75392e3afa62838028.tar.bz2 ranch-3ff117e9ab17488662c7ef75392e3afa62838028.zip |
Change ranch_conns_sup update from supervisor to advanced
-rw-r--r-- | src/ranch.appup | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ranch.appup b/src/ranch.appup index 9196d0d..2a8f667 100644 --- a/src/ranch.appup +++ b/src/ranch.appup @@ -1,3 +1,14 @@ +%% ranch_conns_sup is a custom supervisor (special process), +%% not an OTP supervisor. When "supervisor" is used, the +%% module is always loaded before calling system_code_change, +%% for both upgrade and downgrade operations. This is so that +%% the supervisor's init callback of the upgraded/downgraded +%% module gets called. But the custom supervisors in Ranch +%% do not have an init callback and therefore can function +%% like other special processes: when upgrading, load the +%% module then call system_code_change; and when downgrading, +%% call system_code_change and then load the module. + %% @todo Remove the ending .* before release, we do not %% want to support upgrades from/to release candidates. @@ -8,7 +19,8 @@ {load_module, ranch_acceptor}, {update, ranch_acceptors_sup, supervisor}, {load_module, ranch_app}, - {update, ranch_conns_sup, supervisor}, + %% See comments at the top of the file about ranch_conns_sup. + {update, ranch_conns_sup, {advanced, []}}, {update, ranch_conns_sup_sup, supervisor}, {load_module, ranch_crc32c}, {update, ranch_embedded_sup, supervisor}, @@ -29,7 +41,8 @@ {load_module, ranch_acceptor}, {update, ranch_acceptors_sup, supervisor}, {load_module, ranch_app}, - {update, ranch_conns_sup, supervisor}, + %% See comments at the top of the file about ranch_conns_sup. + {update, ranch_conns_sup, {advanced, []}}, {update, ranch_conns_sup_sup, supervisor}, {load_module, ranch_crc32c}, {update, ranch_embedded_sup, supervisor}, |