Projects tigase _server server-core Issues #1223
NPE in ClusterConnectionManager during restart (#1223)
wojciech.kapcia@tigase.net opened 4 years ago
[2020-12-01 18:27:42:304] [FINEST  ] [ResultsListener-socketReadThread-4 ] SocketThread$ResultsListener.run(): COMPLETED: SocketIO, ID: null, connected Socket[addr=/10.0.8.212,port=14238,localport=5277]
[2020-12-01 18:27:42:305] [FINEST  ] [ResultsListener-socketReadThread-4 ] SocketThread.addSocketServicePriv(): Adding to waiting: jid: ip-10-0-8-212.us-west-2.compute.internal, XMPPIOService, UniqueId: 10.0.39.241_5277_10.0.8.212_14238, type: <- incoming (accept), SocketIO, ID: null, connected Socket[addr=/10.0.8.212,port=14238,localport=5277]
[2020-12-01 18:27:42:306] [FINER   ] [      pool-37-thread-1 ] SocketIO.read()                  : Read from channel 161 bytes [SocketIO, ID: null, connected Socket[addr=/10.0.8.212,port=14242,localport=5277]]
[2020-12-01 18:27:42:306] [FINER   ] [      pool-37-thread-6 ] IOService.writeData()            : Data [<handshake/>] writing exception [SocketIO, ID: null, disconnected Socket[addr=/10.0.8.212,port=14244,localport=5277]]java.nio.channels.ClosedChannelException
[2020-12-01 18:27:42:306] [FINER   ] [      pool-37-thread-6 ] IOService.forceStop()            : Force stop called... Socket: SocketIO, ID: null, disconnected Socket[addr=/10.0.8.212,port=14244,localport=5277],
[2020-12-01 18:27:42:306] [FINER   ] [      pool-37-thread-6 ] IOService.forceStop()            : Calling stop on the listener: tigase.cluster.ClusterConnectionManager@186149f9
[2020-12-01 18:27:42:306] [FINER   ] [      pool-37-thread-1 ] SocketIO.read()                  : Read from channel 0 bytes [SocketIO, ID: null, connected Socket[addr=/10.0.8.212,port=14242,localport=5277]]
[2020-12-01 18:27:42:306] [FINE    ] [      pool-37-thread-6 ] ConnectionManager.serviceStopped(): [[cl-comp]] Connection stopped: jid: null, XMPPIOService, UniqueId: 10.0.39.241_5277_10.0.8.212_14244, type: <- incoming (accept), SocketIO, ID: null, disconnected Socket[addr=/10.0.8.212,port=14244,localport=5277]
[2020-12-01 18:27:42:307] [FINER   ] [      pool-37-thread-1 ] SocketIO.read()                  : Read from channel 8,124 bytes [SocketIO, ID: null, connected Socket[addr=/10.0.8.212,port=14246,localport=5277]]
[2020-12-01 18:27:42:307] [WARNING ] [      pool-37-thread-6 ] ConnectionManager.writePacketToSocket(): Exception during writing packets [jid: null, XMPPIOService, UniqueId: 10.0.39.241_5277_10.0.8.212_14244, type: <- incoming (accept), SocketIO, ID: null, disconnected Socket[addr=/10.0.8.212,port=14244,localport=5277]]:
java.lang.NullPointerException
        at tigase.cluster.ClusterConnectionManager.hashCodeForPacket(ClusterConnectionManager.java:253)
        at tigase.server.AbstractMessageReceiver.addPacket(AbstractMessageReceiver.java:277)
        at tigase.cluster.ClusterConnectionManager.processUndeliveredPacket(ClusterConnectionManager.java:461)
        at tigase.server.ConnectionManager.serviceStopped(ConnectionManager.java:488)
        at tigase.cluster.ClusterConnectionManager.serviceStopped(ClusterConnectionManager.java:518)
        at tigase.cluster.ClusterConnectionManager.serviceStopped(ClusterConnectionManager.java:80)
        at tigase.net.IOService.forceStop(IOService.java:266)
        at tigase.xmpp.XMPPIOService.forceStop(XMPPIOService.java:221)
        at tigase.net.IOService.writeData(IOService.java:1007)
        at tigase.xmpp.XMPPIOService.writeRawData(XMPPIOService.java:279)
        at tigase.xmpp.XMPPIOService.processWaitingPackets(XMPPIOService.java:239)
        at tigase.server.ConnectionManager.writePacketToSocket(ConnectionManager.java:596)
        at tigase.cluster.ClusterConnectionManager.processHandshake(ClusterConnectionManager.java:932)
        at tigase.cluster.ClusterConnectionManager.processSocketData(ClusterConnectionManager.java:424)
        at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:345)
        at tigase.server.ConnectionManager.packetsReady(ConnectionManager.java:61)
        at tigase.net.IOService.call(IOService.java:206)
        at tigase.xmpp.XMPPIOService.call(XMPPIOService.java:149)
        at tigase.xmpp.XMPPIOService.call(XMPPIOService.java:50)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
wojciech.kapcia@tigase.net commented 3 years ago

Caused by concurrency issue and breaking of the socket while negotiating it and redelivery packet being <handshake/> which doesn't have to attribute. Added simple protection for that case.

issue 1 of 1
Type
Bug
Priority
Minor
Assignee
Version
tigase-server-8.2.0
Spent time
15m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1223
Please wait...
Page is in error, reload to recover