Open glassfishrobot opened 9 years ago
@glassfishrobot Commented Reported by goleon
@glassfishrobot Commented @pavelbucek said: This could be a bug but for different reason.
The latter usecase should not work at all - onMessage() method shouldn't be invoked in parallel for the same client. Tyrus should make sure that next onMessage() is not invoked before previous one is finished; we cannot assure in-order message delivery otherwise.
@glassfishrobot Commented goleon said: Thanks, could you explain this restriction please. It is from WebSocket transport or JSR 356 standard or from JSR server side or JSR client side implementation?
@glassfishrobot Commented goleon said: And i removed concurrent tasks executor but problem still exists...
@glassfishrobot Commented @pavelbucek said: the "restriction" is from the JSR 356 itself - as I already mentioned, we cannot guarantee in-order message delivery otherwise. Client/Server side does not matter, since they are equal after WebSocket handshake.
I overlooked that you are sending the message from ExecutorService - in that case, it should work; leave it there and to jstack when it "hangs" and post it here, we might be able to find something unusual.
@glassfishrobot Commented This issue was imported from java.net JIRA TYRUS-404
Server side:
Case 1: client sends 1000 messages and received 1000 responses. Appeared result is same as expected. Client with iteration of messages sending:
Case 2: client should send message and receive response 1000 times (algorithm is recursive: next message sending client will make in onMessahe handler). Client with recursive "ping-pong" messages sending:
In recursive algorithm about 25 (or 74, or 90...) messages was sent, but client hanged , logs for example may be that:
As seen client sends message 24 ant it must be received on server, but in server logs i see that message is not received on server, and client hanged. Why?