<div dir="ltr">Dear list,<div>I am using cowboy to handle long lived http connections.</div><div><br></div><div>When a new connection is successful, I link a router process to it with erlang:link/1, which traps exits, so that when I receive the messageĀ {'EXIT', Pid, Reason} I can remove the connection reference from the router process. Pretty standard stuff.</div><div><br></div><div>After Cowboy's terminate/3 callback is called, I immediately see the log that the connection has been removed from the router process too.</div><div><br></div><div>However, in production I see that it can take almost 2 minutes from the moment the terminate/3 function was called, and the router receiving the {'EXIT', Pid, Reason}, which means that after exiting from the terminate/3 function the Cowboy process does not exit for almost 2 minutes:<br></div><div><br></div><div>2015-05-14 21:16:25.302 [debug] <0.1714.0>@myapp_device:terminate:180 Terminated robot request</div><div>[...]</div><div><div>2015-05-14 21:18:15.304 [info] <0.1717.0>@myapp_router:handle_info:157 Now offline</div></div><div><br></div><div>My question is: have you seen this before? Does this mean that the client is badly formed and is refusing to shutdown gracefully? If so, is there a way to close the socket abruptly instead?</div><div><br></div><div>Thank you,</div><div>r.</div></div>