Project

General

Profile

Presence packet processing fails in SessionManager sometimes

Anonymous
Added over 5 years ago

Here is the scenario.

I am using Tigase server 5.1.0 and using PSI and an another client application which uses BOSH to talk to the Tigase server.

I know that it is better to upgrade to the latest version, but we cannot do that unfortunately right now and we are stuck with the version of Tigase we currently are on.

This is what is happening and I dont know if this an issue or a bug, but something seems strange as I cannot reproduce this issue consistently, but its significant as it happens 10% of the time.

So we have user 1 on PSI and logging into via the client application as well. The user stays as available on PSI, and changes his presence to Busy from the client application and then logs off from the client application. User 2 does the same thing as well. Both these users have other contacts on their roster as well.

On certain instances I see that the users' "unavailable"(offline) packet does not get generated properly and sent to the PSI clients. So they see the user's resource connection from the client application as 'busy', although they have logged out from that resource(client application).

I added more logging in the BOSH layer and also in the SessionManager class and I see that sometimes, the unavailable packet gets flagged as a "Broken packet" and when I trace through the code, it looks like the resource connection is not able to be found to process the presence packet. I understand that the sessionCloseProc in the SessionManager takes care of removing the resource connection from the connectionsByFrom map when the user logs out and hence the presence packet errors out in the Session Manager.

Looks like the packet processing order could cause this issue to happen. ????

So for a user, whose presence gets processed properly, this is what i see in the logs:

97 2013-10-24 13:16:31 SessionManager.processPacket() FINEST: Received packet: from=bosh@tigase-dev02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, to=sess-man@tigase-dev02, DATA=, SIZE=67, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable

104 2013-10-24 13:16:31 SessionManager.processPacket() FINEST: processing packet: from=bosh@tigase-dev02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, to=sess-man@tigase-dev02, DATA=, SIZE=67, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable, connection: user_jid=zlouisuser1@zeenie-dev.lab/CasabPresSrvv0.1, packets=9 , connectioId=bosh@tigase-dev02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, domain=zeenie-dev.lab, authState=AUTHORIZED, isAnon=false

112 2013-10-24 13:16:31 SessionManager.walk() FINEST: XMPPProcessorIfc: OfflineMessages (msgoffline)

113 Request: from=bosh@tigase-dev02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, to=sess-man@tigase-dev02, DATA=, SIZE=118, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable, conn: user_jid=zlouisuser1@zeenie-dev.lab/CasabPresSrvv0.1, packets=10, connectioId=bosh@tigase-dev 02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, domain=zeenie-dev.lab, authState=AUTHORIZED, isAnon=false

119 2013-10-24 13:16:31 SessionManager.walk() FINEST: XMPPProcessorIfc: Presence (presence)

120 Request: from=bosh@tigase-dev02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, to=sess-man@tigase-dev02, DATA=, SIZE=118, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable, conn: user_jid=zlouisuser1@zeenie-dev.lab/CasabPresSrvv0.1, packets=10, connectioId=bosh@tigase-dev 02/c51f3ae3-3627-44be-879d-48e3bc5d4bbb, domain=zeenie-dev.lab, authState=AUTHORIZED, isAnon=false

But for a user whose presence fails for some reason, i see the following:

138 2013-10-24 13:16:31 SessionManager.processPacket() FINEST: Received packet: from=bosh@tigase-dev02/af4d226a-e886-4e18-be5e-93cf31c8a0ea, to=sess-man@tigase-dev02, DATA=, SIZE=67, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable

139 2013-10-24 13:16:31 SessionManager.getXMPPResourceConnection() INFO: Message without TO attribute set, don't know what to do wih this: from=bosh@tigase-dev02/af4d226a-e886-4e18-be5e-93cf31c8a0ea, to=se ss-man@tigase-dev02, DATA=, SIZE=67, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable

143 2013-10-24 13:16:31 SessionManager.isBrokenPacket() FINE: Broken packet: from=bosh@tigase-dev02/af4d226a-e886-4e18-be5e-93cf31c8a0ea, to=sess-man@tigase-dev02, DATA=, SIZE=67, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=unavailable

Because of the above errors, the packet does not even get to the walk() which basically triggers a task/packet to be processed by the OfflineMessage and Presence plugin.

Have you seen anything like this before? 90% of the time, it works fine. This is not even with any load on the system. Nothing else goes on when i am testing with these users and use cases. I am pretty convinced that this is not a configuration issue.

Any help is highly appreciated.

Thanks.


Replies (6)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

I think we have fixed a few places of code which caused similar effects. It was a while ago so I do not remember all the details. Some fixes got to the 5.1.x line and one last only got to the 5.2.0. So what you describe might be an old issue indeed.

I understand you cannot update to 5.2.x but maybe you can update the the most recent stable 5.1.5 instead? There would be no compatibility issues, it has only bug fixes so maybe it is worth the try?

Added by Anonymous over 5 years ago

is there a way for me to look at the issues which was fixed in 5.1.5. I would like, if possible to get the fix that addresses this issue(if we can find one), rather than getting the whole release, which would introduce a complete test cycle for us.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

My suggestion is to look through all the tickets associated with subsequent versions: https://projects.tigase.org/projects/tigase-server/roadmap Maybe some of them would give you a hint and/or point you to a particular code change.

Another way to find this out is to review all changes made to SessionManager because this is where this kind of problems were fixed. As I remember some fixes required only SM code change and one or 2 others involved code change in connection manager as well.

Added by Anonymous over 5 years ago

I found:

https://projects.tigase.org/issues/188

Sounds pretty close to what I am experiencing.

But I dont see the portions that I see in the revision diffs on the file which is on trunk.

https://projects.tigase.org/projects/tigase-server/repository/revisions/07d2568969778f8aaba5a482a784b0dfcb011513/diff/src/main/java/tigase/server/xmppsession/SessionManager.java

Assuming that the green portions are what i should have in there. But still the packet is treated as "broken", which is not true. Is it not. This fix even if I take the green portions, would ensure that no "error" packet is generated, but still my presences would not be properly generated, is it not?

Am I missing something, probably an additional fix or some other issue?

Thanks for taking a look.

Added by Anonymous over 5 years ago

Hi Artur,

Does what I say above make sense? The java classes and the code listed in the diff on https://projects.tigase.org/issues/188 is not sufficient to fix the issue that I am trying to address. I was looking at the revisions of BoshSession/BoshCOnnectionManager/SessionManager to see if there were any relevant changes from the check in descriptions. But I could not find anything that would help.

Please let me know if you any piece of code or classes that I should take a look at.

Thanks a lot.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam over 5 years ago

Could you please file a bug report with a detailed description on how to reproduce the issue? We could run tests and if we can reproduce we can fix it. I am not sure if what happens to you is exactly what we already worked on or not.

    (1-6/6)