<div dir="ltr">Thaks for the suggestion.<div><br></div><div>The gen_server already trap exits.</div><div><br></div><div>The instance I am using runs on R20.1. The instance it is communicating with runs on R19. That instance does not show the same behavior even though it uses the same code base for gen_rpc. </div><div>I am worried that it is some strangeness in R20 that I am not aware of.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 7, 2018 at 2:52 PM, Brujo Benavides <span dir="ltr"><<a href="mailto:elbrujohalcon@gmail.com" target="_blank">elbrujohalcon@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 style="word-wrap:break-word;line-break:after-white-space">Not sure if this will help at all, but try trapping exits in that gen_server (i.e. process_flag(trap_exit, true).) since terminate might not be evaluated unless you’re trapping exits. Ref: <a href="http://erlang.org/doc/man/gen_server.html#Module:terminate-2" target="_blank">http://erlang.org/doc/<wbr>man/gen_server.html#Module:<wbr>terminate-2</a><div><br></div><div>Good luck!<br><div>
<div style="color:rgb(0,0,0);font-family:'Trebuchet MS';font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><span id="m_2085460085308166673docs-internal-guid-e691a4cc-056a-0210-b8b7-ea8d87d888ad"><span style="font-size:11pt;font-family:Arial;font-weight:700;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><br class="m_2085460085308166673Apple-interchange-newline"><hr></span></span><div><b><i><a href="http://about.me/elbrujohalcon" target="_blank">Brujo Benavides</a></i></b></div></div></div><div style="color:rgb(0,0,0);font-family:'Trebuchet MS';font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><b><br></b></div><br class="m_2085460085308166673Apple-interchange-newline">
</div>
<div><br><blockquote type="cite"><div><div class="h5"><div>On 7 Mar 2018, at 09:48, Heinrich Venter <<a href="mailto:hfventer@gmail.com" target="_blank">hfventer@gmail.com</a>> wrote:</div><br class="m_2085460085308166673Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr">Hi all<div><br></div><div>I have been experiencing the strangest thing.</div><div><br></div><div>I am using an application (gen_rpc) that internally uses a gen_server to manage a gen_tcp outgoing socket.</div><div><br></div><div>On closing of the socket form the server side, the message {tcp_closed, Socket} is received in the handle_info. This handle_info returns {stop, normal, State}</div><div>BUT</div><div>The gen_server does not actually terminate. It does not call terminate and the PID remains registered locally. It actually keeps on processing messages which leads to badtcp reponses when it tires to send on the failed socket.</div><div><br></div><div>Has any one seen something remotely like this, or have any suggestions of how to proceed?</div><div><br></div><div>Links</div><div><a href="https://github.com/priestjim/gen_rpc" target="_blank">https://github.com/priestjim/<wbr>gen_rpc</a><br></div><div><br></div><div><br></div><div><br></div></div></div></div>
______________________________<wbr>_________________<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/<wbr>listinfo/erlang-questions</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div>