<div dir="ltr">Hi Vimal,<div><br></div><div>I took I quick look on your code and maybe I am wrong but I see this:</div><div>You are calling the method <span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">re_add_monitors_if_crashed</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">()</span>  from   myapp_procmon:start_link/0. This function is called by the supervisor process, for this reason it is attaching the all the monitors to the supervisor. </div><div><br></div><div>You must call that re_add_monitors_if_crashed from the myapp_procmon process, for example in the init/1 function.</div><div><br></div><div>thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-17 12:48 GMT-06:00 Vimal Kumar <span dir="ltr"><<a href="mailto:vimal7370@gmail.com" target="_blank">vimal7370@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello List,</div><div><br></div><div>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?</div><div><br></div><div>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.</div><div><br></div><div>I have made a very small app to show the problem. The code and output is available at <a href="https://github.com/vimal7370/myapp" target="_blank">https://github.com/vimal7370/<wbr>myapp</a> 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.</div><div><br></div><div>Thank you!</div><div><br></div><div>Regards,</div><div>Vimal</div></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><font size="4"><b>Felipe Ripoll Gisbert</b></font><br><a href="http://www.feliperipoll.es" target="_blank">www.feliperipoll.es</a><br><font size="1"><a href="mailto:felipe@feliperipoll.es" target="_blank">felipe@feliperipoll.es</a><br><a href="mailto:ferigis@gmail.com" target="_blank">ferigis@gmail.com</a></font><br></div>
</div>