-
-
Notifications
You must be signed in to change notification settings - Fork 507
Closed connections stay in "FIN_WAIT2" state #306
Comments
I fear you cannot do much in node-land. Using destroy will probably matter a lot. A good measure is to reduce the FIN timeout: https://drupal.star.bnl.gov/STAR/blog-entry/jeromel/2009/feb/18/tcp-parameters-linux-kernel. Also I have seen this change a lot between cloud providers. |
Thanks @mcollina Yeah, this is what I was expecting! I only encounter this problem on Internet facing Mosca servers (dev environment), putting them behind a loadbalancer makes the problem disappear. I'm closing this issue! |
Unfortunately, lowering the
So, for anyone who experiences lots of |
@mcollina I suffered from too many
Can I submit a PR to replace |
I'm ok with |
Excellent, I'll submit that PR! =) Thanks for the quick answer! |
I noticed that some closed connections (on bad mobile networks) stay in
FIN_WAIT2
state.This is the case for permanent connections where the server half closes the connection but the client (boggy or due to bad network) does not close the connection (See this node issue: nodejs/node-v0.x-archive#3613).
May I ask if you or any Mosca user have encountered such problem?
I'm investigating using
socket.destroy()
instead ofsocket.end()
in:https://github.com/mcollina/mosca/blob/master/lib/client.js#L317
https://github.com/mcollina/mosca/blob/master/lib/client.js#L326
https://github.com/mcollina/mosca/blob/master/lib/client.js#L569
The text was updated successfully, but these errors were encountered: