supervisor3 was a bad choice
supervisor3 is stale, lagging behind with the changes in OTP's supervisor.erl
- desired features from
supervisor3 can be addressed with supervisor with some additional retry mechanism.
- children restarts do not cause supervisor restart (this is not really necessary as the children are long lived in
brod)
- delayed restart (need our own delay-retry loop)
not following OTP design principal
brod_client directly spawn_link consumer and producer supervisor makes the processes unreachable from application root supervisor. i.e. it's not a tree.
this makes the release handler unable to traverse all processes from the supervision tree to perform hot-upgrades.
design proposal
- Use supervision tree for all processes.
brod_client should run in a delayed-retry loop to start brod_producers_sup and/or brod_consumers_sup per configuration
- Once a
brod_producers|consumers_sup is started, it should not die at connection restarts (in fact this is the current behavior, it runs in a loop to to poll new leader connection from brod_client.
brod_sup
|
+-- brod_clients_sup
| |
| +-- brod_client (worker)
|
+-- brod_producers_sup
| |......
|
+-- brod_consumers_sup
|......
supervisor3 was a bad choice
supervisor3is stale, lagging behind with the changes in OTP's supervisor.erlsupervisor3can be addressed withsupervisorwith some additional retry mechanism.brod)not following OTP design principal
brod_clientdirectlyspawn_linkconsumer and producer supervisor makes the processes unreachable from application root supervisor. i.e. it's not a tree.this makes the release handler unable to traverse all processes from the supervision tree to perform hot-upgrades.
design proposal
brod_clientshould run in a delayed-retry loop to startbrod_producers_supand/orbrod_consumers_supper configurationbrod_producers|consumers_supis started, it should not die at connection restarts (in fact this is the current behavior, it runs in a loop to to poll new leader connection frombrod_client.