Projects tigase _server server-core Issues #402
Possible race condition issue in StreamManagementIOProcessor (#402)
Closed
Daniele Ricci opened 10 years ago
Due Date
2014-12-30

I recently found this exception in my logs:

java.lang.NullPointerException
        at tigase.server.xmppclient.StreamManagementIOProcessor.processIncoming(StreamManagementIOProcessor.java:203)
        at tigase.xmpp.XMPPIOService.addReceivedPacket(XMPPIOService.java:638)
        at tigase.xmpp.XMPPIOService.processSocketData(XMPPIOService.java:746)
        at tigase.net.IOService.call(IOService.java:261)
        at tigase.net.IOService.call(IOService.java:94)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

That is, outQueue from session is null.

It was probably caused by a very faulty (mobile) connection (I've had a lost message around the time of the exception, stanza id l8W3q11zil4DmWfXt94y1kqw942jGk, maybe it's connected to that error?).

I don't know what other information you might need, just ask, I'll provide anything you might need.

Artur Hefczyc commented 10 years ago

Andrzej, please have a look at it.

Andrzej Wójcik (Tigase) commented 10 years ago

I looked thru your modified sources of Tigase XMPP Server to match line to correct one as in standard Tigase XMPP Server in StreamManagementIOProcessor is empty. The cause for this NPE is bad order of initialization of Stream Management when it is being enabled - I changed this order.

However it may only happen when client will send ACK request just after sending ENABLE request, which I think client should not send until it receives ENABLED stanza, and ENABLED stanza is sent by Tigase XMPP Server only when Stream Management is fully initialized. So from may point of view XMPP client is also misbehaving.

Daniele Ricci commented 10 years ago

Andrzej Wójcik wrote:

I looked thru your modified sources of Tigase XMPP Server to match line to correct one as in standard Tigase XMPP Server in StreamManagementIOProcessor is empty. The cause for this NPE is bad order of initialization of Stream Management when it is being enabled - I changed this order.

I'm sorry I should have indicated that it's my version of the source code.

However it may only happen when client will send ACK request just after sending ENABLE request, which I think client should not send until it receives ENABLED stanza, and ENABLED stanza is sent by Tigase XMPP Server only when Stream Management is fully initialized. So from may point of view XMPP client is also misbehaving.

Indeed, it shouldn't happen. It happens because my client XMPP library (Smack) blindly replies with after receiving an (which the server will send after every because of a custom extension on the server source code, we were talking about this in #2533), but that is probably related to this: https://projects.tigase.org/boards/4/topics/3791?r=3802#message-3802 where I stated that I received a couple of messages during the authentication process (right after enabling compression). Unfortunately I was unable to reproduce it...

Daniele Ricci commented 10 years ago

I'm afraid I can't reproduce this again because of #2561 (it is a very hard condition to reproduce nevertheless). Do you think we can close this issue?

Andrzej Wójcik (Tigase) commented 10 years ago

OK, as you are not able to reproduce and knowing how code was changed I do not think it will occur, so I'm closing issue.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
2536
Spent time
12h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#402
Please wait...
Page is in error, reload to recover