hellozedan / node-xmpp-bosh

Automatically exported from code.google.com/p/node-xmpp-bosh
0 stars 0 forks source link

BOSH session is active, but XMPP connection is lost #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Connect to node-xmpp-bosh via Strophejs w/ Openfire as XMPP server

What version of the product are you using? On what operating system?
0.4.3

Please provide any additional information below.
After idle time, client still connected to BOSH server (ping is working) but 
user is not online on XMPP server.

Original issue reported on code.google.com by rgv151 on 12 Oct 2011 at 11:37

GoogleCodeExporter commented 8 years ago
I'm using Ubuntu 11.10 beta 2, latest Openfire 3.7.1, Strophejs 1.0.2

Original comment by rgv151 on 12 Oct 2011 at 11:39

GoogleCodeExporter commented 8 years ago
Is the same bug present on 0.4.0?

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 12:45

GoogleCodeExporter commented 8 years ago
no it isn't, in this case (0.4.0) BOSH server send terminate signal to client.

but there is another issue, dunno why connection XMPP Server send terminate to 
BOSH while client is still pinging.

Client works fine when connect to Openfire's BOSH server directly.

Original comment by rgv151 on 13 Oct 2011 at 4:21

GoogleCodeExporter commented 8 years ago
@anup: Maybe a refactoring bug?

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 4:26

GoogleCodeExporter commented 8 years ago
0.4.3 has quite a few bugs which got fixed in the last few commits. Need to 
test this on the latest commit.

Original comment by anup.kal...@gmail.com on 13 Oct 2011 at 4:35

GoogleCodeExporter commented 8 years ago
Is there any way you can upload a tarball of the current refactoring branch for 
download on some site so that it can be tested by the reporter?

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 4:39

GoogleCodeExporter commented 8 years ago
I guess you can upload it to mediafire http://www.mediafire.com/ or some file 
hosting service??

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 4:50

GoogleCodeExporter commented 8 years ago
I will test w/ bosh_refactoring branch from svn repo, and feedback asap.

Thank you all.

Original comment by rgv151 on 13 Oct 2011 at 4:53

GoogleCodeExporter commented 8 years ago
@anup: BOSH sends terminate signal to client now.

But, it seems BOSH does not send ping request/reply to XMPP server, so XMPP 
server disconnect the idle clients after timeout is reached

Original comment by rgv151 on 13 Oct 2011 at 5:37

GoogleCodeExporter commented 8 years ago
@rgv151: Does the Bosh server need to send ping request/ reply to the XMPP 
server? I am sorry for not being aware of that. 

@dhruvbird: can that happen? or is there a different issue? what do you say?

Original comment by anup.kal...@gmail.com on 13 Oct 2011 at 5:43

GoogleCodeExporter commented 8 years ago
I don't know, I'm not an XMPP expert. but I think BOSH needs to tell XMPP 
Server that the client is still pinging, and the connection does not appear to 
be lost.

Original comment by rgv151 on 13 Oct 2011 at 5:51

GoogleCodeExporter commented 8 years ago
@rgv151: can you start your server with --logging=DEBUG, replicate the issue 
and send me the logs?

Original comment by anup.kal...@gmail.com on 13 Oct 2011 at 5:54

GoogleCodeExporter commented 8 years ago
here you are!

Original comment by rgv151 on 13 Oct 2011 at 6:09

Attachments:

GoogleCodeExporter commented 8 years ago
The logs do not reflect any wrong doing on the BOSH part. There is a stream 
terminate response from the server:

DEBUG Thu Oct 13 2011 13:05:22 GMT+0700 (ICT) XMPP 
PROXY::received:</stream:stream>

In xmpp, AFAIK, there is no need to do any ping exchange with the server, 
unless your server mandates you to do that. The pinging between the client and 
the BOSH is only to make the client-BOSH server connection alive.

We need to find out why the server is terminating the stream. If you have any 
server API where it is mentioned to maintain any ping exchange, let me know.  

Original comment by anup.kal...@gmail.com on 13 Oct 2011 at 8:47

GoogleCodeExporter commented 8 years ago
I'm debugging, will report back later. Thank you!

Original comment by rgv151 on 13 Oct 2011 at 9:37

GoogleCodeExporter commented 8 years ago
@rgv151: I hope you are pulling from the right branch. Here it is: svn checkout 
http://node-xmpp-bosh.googlecode.com/svn/branches/bosh_refactoring 
node-xmpp-bosh-read-only

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 11:47

GoogleCodeExporter commented 8 years ago
@rgv151: BOSH is just a proxy between the client & server. It will "generally" 
never initiate packets (even ping packets) between itself and the server or 
itself and the client. It just relays data from the client to the server and 
vice-versa.

In fact a BOSH server SHOULD NOT be sending ping packets to the server unless 
the client has sent them. Makes sense?

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 11:50

GoogleCodeExporter commented 8 years ago
@rgv151: I think what you "could be" referring to is keep-alive packets. There 
is a provision to configure a TCP keepalive for sockets. (not sure if NXB 
allows that for server sockets in the configuration). However, many 
servers/clients periodically send a single space character to keep the 
connection alive. Is this the "ping" that you are talking about?

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 11:53

GoogleCodeExporter commented 8 years ago
I'm using the tarball from @anup, and it's from that branch.

Ping is the empty request client send to server, to let it knows that the 
client is still alive.

I'm sure that XMPP Proxy just relays data, but when client is idle, it sends 
ping package to BOSH server, so BOSH have to send something to XMPP server too, 
am i right? if not, how XMPP server knows that the client is still alive?

I don't see BOSH send anything to XMPP server while client is pinging...

Original comment by rgv151 on 13 Oct 2011 at 2:54

GoogleCodeExporter commented 8 years ago
@rgv151: BOSH server makes a persistent TCP socket (for the lifetime of the 
session) to the XMPP server for each client and the XMPP spec does not mandate 
any ping between the two. Socket termination implies that the client is not 
alive and will need the session establishment once again.  

Original comment by anup.kal...@gmail.com on 13 Oct 2011 at 3:13

GoogleCodeExporter commented 8 years ago
@rvg151: The empty request that the client sends to BOSH is to let it know that 
it is alive. The BOSH server need not send this to the XMPP server - I hope 
that clears things up.

Or another way to look at it is this: The empty packet doesn't contain any XMPP 
(XML) data, so the BOSH server sends 0 bytes to the XMPP server when it 
receives such a packet.

Original comment by dhruvb...@gmail.com on 13 Oct 2011 at 5:24

GoogleCodeExporter commented 8 years ago
thank you for the information, but I still confusing.. I will investigate about 
this.

Best regards,
Bruce

Original comment by rgv151 on 14 Oct 2011 at 2:28

GoogleCodeExporter commented 8 years ago
Hello Bruce. You can check http://xmpp.org/extensions/xep-0124.html for the 
text "empty <body/>" - basically the places that the XEP mentions empty body 
being sent by the client to the bosh proxy.

Original comment by dhruvb...@gmail.com on 14 Oct 2011 at 3:15