<div dir="ltr">Shell input/output logs below.<div><br></div><div>============================</div><div>4> process_info(pid(0,453,4757)).<br></div><div><div>[{current_function,{<u><i>gen,do_call,4</i></u>}},</div><div> {initial_call,{proc_lib,init_p,5}},</div>
<div> {status,<u><i>waiting</i></u>},</div><div> {message_queue_len,1},</div><div> {messages,[<u><i>{'$gen_call',{<0.26172.4841>,</i></u></div><div><u><i>                          #Ref<0.0.2946.93178>},</i></u></div>
<div><u><i>                         state}</i></u>]},</div><div> {links,[<0.25337.4839>]},</div><div> {dictionary,[{'$ancestors',[<0.452.4757>,<0.424.0>,</div><div>                             <0.423.0>,ranch_sup,<0.420.0>]},</div>
<div>              {'$initial_call',{my_session,init,1}}]},</div><div> {trap_exit,true},</div><div> {error_handler,error_handler},</div><div> {priority,normal},</div><div> {group_leader,<0.419.0>},</div><div>
 {total_heap_size,1364},</div><div> {heap_size,987},</div><div> {stack_size,32},</div><div> {reductions,1487},</div><div> {garbage_collection,[{min_bin_vheap_size,46368},</div><div>                      {min_heap_size,233},</div>
<div>                      {fullsweep_after,65535},</div><div>                      {minor_gcs,8}]},</div><div> {suspending,[]}]</div></div><div>=============================</div><div><br></div><div style>As you can see the process has a message {..., state} in it's message queue but still in waiting state. It doesn't respond to gen_server:call(Pid, state) from this point on.  The process_info shows that the process is now in gen:do_call/4 which is not under my control. The module has all the fallback handlers for handle_call/3, handle_cast/2, handle_info/2 etc, so that every message be matched. There are a couple of places in my project where gen_server:call/2 used against this process.  I suppose that the calls should timeout in 5 sec by default as is stated in the gen_server specification.  So there should be no such case that the process stuck indefinitely.</div>
<div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 3, 2013 at 7:39 PM, Aaron France <span dir="ltr"><<a href="mailto:aaron.l.france@gmail.com" target="_blank">aaron.l.france@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Does it make any synchronous calls to other gen_servers?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jun 3, 2013 at 12:34 PM, Tim Watson <span dir="ltr"><<a href="mailto:watson.timothy@gmail.com" target="_blank">watson.timothy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Does the callback module execute any selective receives inside handlers perhaps? If not, are you sure the message has actually arrived in that process' mailbox, can you see unhandled messages in the message queue (I.e., length > 0 whilst waiting)?<br>


<div><div><br>
On 3 Jun 2013, at 10:34, "Park, Sungjin" <<a href="mailto:jinni.park@gmail.com" target="_blank">jinni.park@gmail.com</a>> wrote:<br>
<br>
> Guys,<br>
><br>
> I'm encountering cases when gen_server doesn't respond.<br>
> In such cases, erlang:process_info/1 shows the process state 'waiting' with some messages in the message_queue.  The messages have not been consumed for tens of minutes at least.  Anybody has any idean about this?<br>


><br>
><br>
> --<br>
> Park, Sungjin<br>
> -------------------------------------------------------------------------------------------------------------------<br>
> Peculiar travel suggestions are dancing lessons from god.<br>
>   -- The Books of Bokonon<br>
> -------------------------------------------------------------------------------------------------------------------<br>
</div></div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><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://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Park, Sungjin<div>-------------------------------------------------------------------------------------------------------------------</div><div>Peculiar travel suggestions are dancing lessons from god.</div>
<div>  -- The Books of Bokonon</div><div>-------------------------------------------------------------------------------------------------------------------</div>
</div>