<div dir="ltr"><br><div class="gmail_quote">On Mon, Sep 22, 2008 at 8:10 AM, <span dir="ltr"><<a href="mailto:Dana.RUBINO@rbs.com">Dana.RUBINO@rbs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span>Hi Edwin,</span></font></div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span></span></font> </div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span>Thanks for the advice!</span></font></div></div></blockquote><div><br>You're welcome.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span></span></font></div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span></span></font> </div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span>I think you may be correct in
that it appears the second process is dying shortly after being
started - the log is indicating it is being started! (they don't register
themselves)</span></font></div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span></span></font> </div></div></blockquote><div><br>Well, is it possible that they are both contending for the same resource (a socket?) and the first process to get it wins? Did you try starting SASL?<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div dir="ltr" align="left"></div>
<div dir="ltr" align="left"><font size="2" color="#0000ff" face="Arial"><span>Slightly off-topic, any ideas why the appmon uses such
a large amount of memory when switching to sup view from proc?
</span></font></div></div></blockquote><div><br>Sorry, no idea.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div dir="ltr" align="left">
<font size="2" color="#0000ff" face="Arial"><span></span></font></div>
<div><font size="2" color="#0000ff" face="Arial"></font> </div>
<div><span><font size="2" color="#0000ff" face="Arial">Many
thanks,</font></span></div>
<div><span><font size="2" color="#0000ff" face="Arial">Dan</font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font size="2" face="Tahoma"><b>From:</b> <a href="mailto:emofine@gmail.com" target="_blank">emofine@gmail.com</a>
[mailto:<a href="mailto:emofine@gmail.com" target="_blank">emofine@gmail.com</a>] <b>On Behalf Of </b>Edwin Fine<br><b>Sent:</b> 22
September 2008 12:27<br><b>To:</b> RUBINO, Dana, GBM<br><b>Cc:</b>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><b>Subject:</b> Re: [erlang-questions] Gen
supervisor query...<br></font><br></div><div><div></div><div class="Wj3C7c">
<div></div>
<div dir="ltr">Hi Dan<br><br>The first thing that comes to mind is, does the
generic_tcp_server register itself? If so, the second one will fail to start. Do
you see any error messages? I find if you start SASL before you run your
program, you may get better error information (application:start(sasl), or -boot
sasl on the command line). Anotyher possibility is, could one of them have died
before you looked in appmon? What does your output/error log look
like?<br><br>The other thing is, instead of explicitly looking in registered()
for your connection monitor, you coud just use whereis():<br><br><span style="font-family: courier new,monospace;">case whereis(<font size="2">?CONNCOUNTER) of<br> undefined -> % Not
registered<br> </font></span><font style="font-family: courier new,monospace;" size="2"><span></span>register(?CONNCOUNTER, spawn(fun() -> counter(0,
MaxConnections) end)),</font><font style="font-family: courier new,monospace;" size="2"><br> error_logger:info_msg("TCP
server <~p> started TCP connection monitor.~n", [self()])</font><span style="font-family: courier new,monospace;">;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Pid
-></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><font size="2">
error_logger:info_msg(<br>
"TCP connection monitor (~p) already registered as ~p
...SKIPPING~n",<br>
[?CONNCOUNTER, Pid]<br>
)</font></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br><br>Hope this
helps.<br><br>
<div class="gmail_quote">2008/9/22 <span dir="ltr"><<a href="mailto:Dana.RUBINO@rbs.com" target="_blank">Dana.RUBINO@rbs.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><span><font size="2" face="Arial">Hi all,</font></span></div>
<div><span><font size="2" face="Arial"></font></span> </div>
<div><span><font size="2" face="Arial">I have a simple supervisor setup which is
watching two worker processes.</font></span></div>
<div><span><font size="2" face="Arial"></font></span> </div>
<div><span><font size="2" face="Arial">Now I have created the init method as
such:</font></span></div>
<div><span><font size="2" face="Arial"></font></span> </div>
<div><span>
<p align="left"><font size="2">init(Args) -></font></p>
<p align="left"><font size="2"><span>
</span>[{port,Port},{maxconns, MaxConnections},{sockethandlermod,
SocketHandlerMod}] = Args,</font></p>
<p align="left"><font size="2"></font></p>
<p align="left"><font size="2"><span> </span>Registered =
registered(),</font></p>
<p align="left"><font size="2"><span> </span>case
lists:any(fun(X) -> X =:= ?CONNCOUNTER end, Registered) of</font></p>
<p align="left"><font size="2"><span>
</span>true -> </font></p>
<p align="left"><font size="2"><span>
</span>error_logger:info_msg("TCP connection monitor (~p) already
registered...SKIPPING~n",[?CONNCOUNTER]);</font></p>
<p align="left"><font size="2"><span>
</span>false -> </font></p>
<p align="left"><font size="2"><span>
</span>register(?CONNCOUNTER, spawn(fun() -> counter(0, MaxConnections)
end)),</font></p>
<p align="left"><font size="2"><span>
</span>error_logger:info_msg("TCP server <~p> started TCP connection
monitor.~n", [self()])</font></p>
<p align="left"><font size="2">end,</font></p>
<p align="left"><font size="2"></font> </p>
<p align="left"><font size="2">GenTcpServer1 =
{'GenTcpServer1',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},</font><font size="2">permanent,2000,worker,[generic_tcp_server]},</font></p>
<p align="left"><font size="2"></font></p>
<p align="left"><font size="2">GenTcpServer2 =
{'GenTcpServer2',{generic_tcp_server,start_link,[Port,SocketHandlerMod]},</font><font size="2">permanent,2000,worker,[generic_tcp_server]},</font></p>
<p align="left"><font size="2"></font></p>
<p><font size="2">{ok,{{one_for_one,0,1}, [GenTcpServer1,
GenTcpServer2]}}.</font></p></span></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2"><span>N</span>othing fancy going on there - I would expect this supervisor to start both GenTcpServer1 AND GenTcpServer2 given two speca have been returned?</font></div>
<div><font size="2"></font> </div>
<div><font size="2">F<span>or some reason it is only starting one when I look in
appmon etc.</span></font></div>
<div><font size="2"><span></span></font> </div>
<div><font size="2"><span>Any thoughts?</span></font></div>
<div><font size="2"><span></span></font> </div>
<div><font size="2"><span>Many Thanks,</span></font></div>
<div><font size="2"><span>Dan</span></font></div>
<div><br></div>
<div><font size="2" face="Arial"></font> </div><pre>***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.
Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.
Visit our websites at:
<a href="http://www.rbs.com" target="_blank">www.rbs.com</a>
<a href="http://www.rbs.com/gbm" target="_blank">www.rbs.com/gbm</a>
<a href="http://www.rbsgc.com" target="_blank">www.rbsgc.com</a>
***********************************************************************************
</pre></div><br>_______________________________________________<br>erlang-questions
mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>