eclipse-ee4j / tyrus

Tyrus
Other
113 stars 36 forks source link

Connection Closed error #829

Open punitsa opened 1 year ago

punitsa commented 1 year ago

hi.

I am receiving following error when reading from a queue. this does not happen always. we have about 8000 queues and this happens randomly. but currently it is persisting on 1 queue for 1 specific message.

also I am not able to find how to enable debug to find what is the exact stack trace for the exception.

any help would be appreciated.

org.springframework.messaging.simp.stomp.ConnectionLostException: Connection closed at org.springframework.messaging.simp.stomp.DefaultStompSession.afterConnectionClosed(DefaultStompSession.java:487) ~[spring-messaging-4.3.23.RELEASE.jar:4.3.23.RELEASE] at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.afterConnectionClosed(WebSocketStompClient.java:353) ~[spring-websocket-4.3.23.RELEASE.jar:4.3.23.RELEASE] at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.onClose(StandardWebSocketHandlerAdapter.java:141) ~[spring-websocket-4.3.23.RELEASE.jar:4.3.23.RELEASE] at org.glassfish.tyrus.core.TyrusEndpointWrapper.onClose(TyrusEndpointWrapper.java:1235) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.core.TyrusWebSocket.onClose(TyrusWebSocket.java:110) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.client.TyrusClientEngine$TyrusReadHandler.handle(TyrusClientEngine.java:734) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.container.grizzly.client.GrizzlyClientFilter$ProcessTask.execute(GrizzlyClientFilter.java:466) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.container.grizzly.client.TaskProcessor.processTask(TaskProcessor.java:91) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.container.grizzly.client.TaskProcessor.processTask(TaskProcessor.java:68) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.tyrus.container.grizzly.client.GrizzlyClientFilter.handleRead(GrizzlyClientFilter.java:249) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:515) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569) ~[tyrus-standalone-client-1.20.jar:?] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549) ~[tyrus-standalone-client-1.20.jar:?] at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_111]

jansupol commented 1 year ago

From the stack trace it is difficult to say why the connection should not be closed.

These types of intermittent bugs are hard to debug. Is the specific message any different from the others? Does it contain some special characters that may make the stream understood incorrectly? (I expect it does not, but try to use the information provided in the issue description). Could there be some multithreading involved in causing some race conditions? Is the older Tyrus version causing the same issue? (I assume so.) Could some newer JDK help? (I saw some weird things happening with pre 1.8.0_222).

punitsa commented 1 year ago

I am going to try and upgrade 1.8.0_275 tonight. will update if it works.

any comment on how to add more logging to tyrus jdk.

[update]

the problem persists with 1.8.0_275. any other recommendations.?

jansupol commented 1 year ago

@punitsa Sorry, really it is hardly possible to see what's wrong just from the stack trace. Have you tried any other thing I mentioned? The JDK option was not very likely, I admit. Have you tried to reproduce the issue to be able to hunt the source?