Verify that the process is alive in lookup/2
Fixes a data-race between an ets read from lookup/2 and the ets write from the 'DOWN' handler of a registered process which causes intermittent failures in supervision strategies.
In practice, the problem can occur quite often in tests which assert the init behaviour of gen_server's. In production, the already_started errors can cause a single failure to cascade and restart the parent supervisor.
A similar approach is taken in Elixir's Registry (also backed by ets)
Fixes https://github.com/ostinelli/syn/issues/48
I added a check to avoid a rpc, as the aliveness check is necessary for only local processes: https://github.com/ostinelli/syn/compare/872f137c5da0fc4978e1e6fe545b33c058ca09f6..4e1b194012e8be6b0253375c2dd9a4b4196cda41
Hi!
When you have a chance, could you please re-review?