Export to GitHub

socketio-java - issue #9

TransportBuffer.putMessage hangs for 5 minutes on large messages


Posted on Feb 22, 2011 by Grumpy Bird

Hello,

> What steps will reproduce the problem?

Send a large message (around 10 KB) using XHRTransport.

> What is the expected output? What do you see instead?

Transport.sendMessage() should never block for more then a few milliseconds.

TransportBuffer.putMessage tries to acquire a Semaphore and finally times out after 5 minutes. It uses the lock count of the semaphore as pointer into the buffer, so if the message to be sent is larger than the buffer, it will not be able to acquire the semaphore.

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

socket.io-java-20101204.jar on Ubuntu 10.10 and Debian 5.0.8

> Please provide any additional information below.

prio=10 tid=0x00007fe5bc1b5800 nid=0xba8 waiting on condition [0x00007fe5c274e000] java.lang.Thread.State: TIMED_WAITING (parking) sun.misc.Unsafe.park(Native Method) parking to wait for <0x00000000fcfdab80> (a

java.util.concurrent.Semaphore$NonfairSync)

java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)

java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1037)

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)

java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:584)

com.glines.socketio.server.transport.TransportBuffer.putMessage(TransportBuffer.java:123)

com.glines.socketio.server.transport.XHRTransport$XHRSessionHelper.sendMessage(XHRTransport.java:102)

com.glines.socketio.server.transport.XHRTransport$XHRSessionHelper.sendMessage(XHRTransport.java:125)

Hendrik

Comment #1

Posted on Feb 22, 2011 by Grumpy Bird

Sorry, the first file was cut off, here is the complete message:

Attachments

Status: New

Labels:
Type-Defect Priority-Medium