I have a fairly simple WebSocket client that sends a series of messages to a remote socket endpoint (JS AngularJS app) in JSON:
ByteBuffer buf = ByteBuffer.wrap(bout.toByteArray());
session.getAsyncRemote().sendBinary(buf);
The system will run for several hours and every once in a while this messages starts filling up the logs in Wildfly:
2016-04-26 17:42:43,072 ERROR [org.xnio.listener] (default I/O-8) XNIO001008: A channel exception handler threw an exception: java.lang.IllegalStateExcep$
at io.undertow.websockets.jsr.SendResultFuture.onError(SendResultFuture.java:55)
at io.undertow.websockets.core.WebSockets$2.handleException(WebSockets.java:426)
at io.undertow.websockets.core.WebSockets$2.handleException(WebSockets.java:422)
at org.xnio.ChannelListeners.invokeChannelExceptionHandler(ChannelListeners.java:126)
at org.xnio.ChannelListeners$14.handleEvent(ChannelListeners.java:416)
at org.xnio.ChannelListeners$14.handleEvent(ChannelListeners.java:409)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.ChannelListeners$4.run(ChannelListeners.java:147)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:580)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:464)
I think the futures are not being canceled when the socket is closed (for example if the remote endpoint goes away).
Reviewed this code:
Line 55 is happening repeatedly and causing an error level log in Wildfly.
I am happy to share my websocket code if it will help you. Let me know.
I have tried a few things to make this go away. The logs being filled by this error cause my system to fail for users a bit because of the CPU resources.
- clones
-
UNDERTOW-701 Wildfly 10 (& 9) websocket producing massive logs on websocket error (async send only)
- Resolved