You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Richard Eckart de Castilho (Jira)" <ji...@apache.org> on 2019/10/01 10:30:00 UTC

[jira] [Created] (WICKET-6706) Websocket Endpoint logs exception when user leaves page

Richard Eckart de Castilho created WICKET-6706:
--------------------------------------------------

             Summary: Websocket Endpoint logs exception when user leaves page
                 Key: WICKET-6706
                 URL: https://issues.apache.org/jira/browse/WICKET-6706
             Project: Wicket
          Issue Type: Bug
          Components: wicket-native-websocket
    Affects Versions: 8.5.0
            Reporter: Richard Eckart de Castilho
            Assignee: Martin Tzvetanov Grigorov


The Wicket Websocket endpoint seems to log an EOF exception which happens in a very common scenario, namely the user leaves the page:

2019-10-01 12:15:19 ERROR [SYSTEM] WicketEndpoint - An error occurred in web socket connection with id : 0
java.io.EOFException: null
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1206) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1140) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:72) ~[tomcat-embed-websocket-9.0.17.jar:9.0.17]
	at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171) ~[tomcat-embed-websocket-9.0.17.jar:9.0.17]
	at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151) ~[tomcat-embed-websocket-9.0.17.jar:9.0.17]
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148) [tomcat-embed-websocket-9.0.17.jar:9.0.17]
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.17.jar:9.0.17]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

I have looked around on the web to figure out how to avoid this issue and it appears to me that the common solution is to ignore this particular error. So I wonder: would it be reasonable to change the WicketEndpoint onError method to specifically filter out this error:

	@Override
	public void onError(Session session, Throwable t)
	{
		LOG.error("An error occurred in web socket connection with id : " + session.getId(), t); // ADD IF STATEMENT HERE TO NOT LOG EOF EXCEPTIONS
		super.onError(session, t);

		if (isApplicationAlive())
		{
			javaxWebSocketProcessor.onError(t);
		}
	}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)