powered by Jive Software

Stack overflow exception

Hi,

I’'ve gotten a stack over flow exception a couple of times this afternoon while running the server:

2003.06.18 16:28 [com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:171)

] Internal server error

java.net.SocketException: Socket closed

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)

at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:402)

at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:406)

at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:150)

at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)

at java.io.BufferedWriter.flush(BufferedWriter.java:230)

at org.xmlpull.mxp1.serializer.MXSerializer.flush(MXSerializer.java:704)

at com.jivesoftware.util.XPPWriter.write(XPPWriter.java:47)

at com.jivesoftware.xmpp.XMPPDocumentPacket.send(XMPPDocumentPacket.java:408)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:156)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)

at com.jivesoftware.xmpp.spi.PacketTransporterImpl.deliver(PacketTransporterImpl.j ava:80)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.removeSession(SessionManagerImpl.j ava:780)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.onConnectionClose(SessionManagerIm pl.java:835)

at com.jivesoftware.xmpp.spi.BasicConnection.notifyCloseListeners(BasicConnection. java:58)

at com.jivesoftware.xmpp.net.SocketConnection.close(SocketConnection.java:134)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:172)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)

at com.jivesoftware.xmpp.spi.PacketTransporterImpl.deliver(PacketTransporterImpl.j ava:80)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.removeSession(SessionManagerImpl.j ava:780)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.onConnectionClose(SessionManagerIm pl.java:835)

at com.jivesoftware.xmpp.spi.BasicConnection.notifyCloseListeners(BasicConnection. java:58)

at com.jivesoftware.xmpp.net.SocketConnection.close(SocketConnection.java:134)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:172)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)

at com.jivesoftware.xmpp.spi.PacketTransporterImpl.deliver(PacketTransporterImpl.j ava:80)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.removeSession(SessionManagerImpl.j ava:780)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.onConnectionClose(SessionManagerIm pl.java:835)

at com.jivesoftware.xmpp.spi.BasicConnection.notifyCloseListeners(BasicConnection. java:58)

at com.jivesoftware.xmpp.net.SocketConnection.close(SocketConnection.java:134)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:172)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)

at com.jivesoftware.xmpp.spi.PacketTransporterImpl.deliver(PacketTransporterImpl.j ava:80)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.removeSession(SessionManagerImpl.j ava:780)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.onConnectionClose(SessionManagerIm pl.java:835)

at com.jivesoftware.xmpp.spi.BasicConnection.notifyCloseListeners(BasicConnection. java:58)

at com.jivesoftware.xmpp.net.SocketConnection.close(SocketConnection.java:134)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:172)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)

at com.jivesoftware.xmpp.spi.PacketTransporterImpl.deliver(PacketTransporterImpl.j ava:80)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.removeSession(SessionManagerImpl.j ava:780)

at com.jivesoftware.xmpp.spi.SessionManagerImpl.onConnectionClose(SessionManagerIm pl.java:835)

at com.jivesoftware.xmpp.spi.BasicConnection.notifyCloseListeners(BasicConnection. java:58)

at com.jivesoftware.xmpp.net.SocketConnection.close(SocketConnection.java:134)

at com.jivesoftware.xmpp.net.SocketConnection.deliver(SocketConnection.java:172)

at com.jivesoftware.xmpp.net.SocketPacketWriteHandler.handleMessages(SocketPacketW riteHandler.java:48)

at com.jivesoftware.xmpp.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.java: 41)


It continues on like that so it seems like it is stuck in some kind of infinitely recursive loop.

Let me investigate. The current server doesn’‘t have looping control because we aren’'t doing server-to-server yet. But looks like I may need to do it. Were people going offline and online frequently to cause a routing confusion or was it occuring when the server was essentially running steady state?

We were going to release the 1.0.4 today but I’'ll delay it until this is resolved.

-iain

Shoot. I found the problem pretty quickly (indicating it was pretty dumb). Let me run a few tests to make sure. We may be able to release 1.0.4 today after all. Thanks for the bug report though. Looks like this one only occurs when someone goes offline at just the right (er, wrong) time.

-iain

Hi iain … How you doing ?

I’‘m facing the same problem here … I’'m running resin application server and client that simulates hundreds of users … the clinet sends HTTP requests and the application replies on certain port to the clients (threads) … after like running this for a day … I see a lot of jammed threads at this point (fluch call) … would YOU PLEASE let me know what did you find … ???

Thank you so much !!!

Hi,

The problem should have been fixed in the 1.0.5 and later releases. What version are you running now? If you are running a later version, can you try running your same tests with the server in standalone mode?

As for threading, the server keeps a thread for each client connection (an unfortunate scalability limitation for the current server in order to maintain JDK 1.3 compatibility). As long as clients remain connected (even if idle) they will require a thread. In addition, connection shutdowns are detected using standard Java close detection. This means only ‘‘clean’’ socket disconnects are immediately detected and the threads shutdown. Clients that disconnect abruptly will have their connections linger according to your operating system’'s socket timeout settings.

If there is still a remaining problem, I very much want to get to the bottom of it.

-iain