biddyweb / socketio-java

Automatically exported from code.google.com/p/socketio-java
0 stars 0 forks source link

TransportBuffer.putMessage hangs for 5 minutes on large messages #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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(Abstr
actQueuedSynchronizer.java:1037)

java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(Abst
ractQueuedSynchronizer.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(X
HRTransport.java:102)

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

Hendrik

Original issue reported on code.google.com by HendrikU...@nexgo.de on 22 Feb 2011 at 8:27

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, the first file was cut off, here is the complete message:

Original comment by HendrikU...@nexgo.de on 22 Feb 2011 at 8:37

Attachments: