[erlang-questions] Issue with process monitor

Vimal Kumar vimal7370@REDACTED
Sat Jun 17 20:48:41 CEST 2017

Hello List,

I am writing an Erlang application in which the main supervisor spawns a
child process (let's call it 'Process Monitor' process) which in turn
monitors the children of another simple-one-for-one supervisor. What I
notice is, if I deliberately kill this 'Process Monitor', all the monitors
it had will automatically attach to the main supervisor (even though the
main supervisor will have no idea how to handle those child processes DOWN
messages if they arrive later, isn't it??). Is this normal and by design?

Also, since the 'Process Monitor' process is part of the supervision tree,
it restarts and I coded it in such a way to try to monitor those child
processes again. Calling erlang:monitor/2 returns the MonitorRef but it
does not seem to work.

I have made a very small app to show the problem. The code and output is
available at https://github.com/vimal7370/myapp and it would be great if
someone can take a quick look at the code, or clone and run it and guide me
on what I am doing wrong.

Thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170618/30c07366/attachment.htm>

More information about the erlang-questions mailing list