xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

strange 'terminate' #27

Closed vinnitu closed 12 years ago

vinnitu commented 12 years ago

I made logging jsjac to node-xmpp-bosh and get interesting situation

please see next link http://pastebin.com/GT1A1Mdk

after <body xmlns="http://jabber.org/protocol/httpbind" condition="item-not-found" message="Invalid session ID" type="terminate"/>

client continue pings and seems works...

satyamshekhar commented 12 years ago

Can you tell us the version of node-xmpp-bosh that you are running?

Also, if this is reproducible can you tell us how to reproduce it?

vinnitu commented 12 years ago

v0.6.0, but maybe wrong nginx sessions maybe cause of fail, below parts of config:

proxy_connect_timeout 1s; ... /chat backend { ip hash; server one:5280 max_fails=0; server two:5281 max_fails=0; }

and nginx logs has (110: Connection timed out)

but 2 node-xmpp-bosh servers eat about 60% CPU each

I am not a specilist in nginx (it is work of our admin), but maybe something wrong with proxy_connect_timeout or max_fails?..

vinnitu commented 12 years ago

seems proxy_connect_timeout is too small, with 5s works fine (seems) imho nginx after error 110 trying to send request to other server with hasn't such sid, and next request back to right server...

dhruvbird commented 12 years ago

This is expected behaviour. IIRC ( @satyamshekhar plz. can you confirm? ) if a client sends an invalid "sid", then the session is NOT terminated since there is no session to terminate! The bosh server doesn't know which session is being referred to (assuming that the request is going to the wrong xmpp server).

dhruvbird commented 12 years ago

@vinnitu You should use the nginx sticky module for sticky sessions.