Skip to content

[rfc] redesign the process management tree #546

Description

@zmstone

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions