Mob.Diag.Heir (mob v0.9.7)

Copy Markdown View Source

Holds diagnostic tables while their owner is down, and starts the next owner.

Every Mob.Diag.Store table names this process as its ETS heir, with the store as heir data, so a store owner that dies hands its tables — rows intact and still writable, since they are public — here instead of deleting them. The heir then starts a replacement owner, which takes them back with give_back/2. Nothing else would: Mob.Diag.Store.ensure/1 only checks that a store's tables exist, and they do, so without a restart the heir held them until it died too and took every row with it (MOB-302).

The restart runs in a process of its own. The new owner's setup calls give_back/2, which the heir could not answer while starting it, and a store that fails to start must not take the heir down. Started on first use and unlinked, like the owners.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.