citrus icon indicating copy to clipboard operation
citrus copied to clipboard

Dangling Websocket sessions throw exceptions after timeout

Open svettwer opened this issue 7 years ago • 1 comments

As reported in #338:

The next thing: I want to close them [Websocket sessions] because I don't want old sessions hang. Also after some time they start to close by Idle Timeout and I see error stacktraces in logs. (Actually it will happen only if my tests will be executed longer than 5 mins. Right now I don't have a lot of tests and the suit finishes before I see these stacktraces)

One should find a way to close the sessions after they're not longer required by the test case, so that they don't throw exceptions on timeout. Those exceptions are not relevant from a technical perspective but they may cause confusion of the user.

svettwer avatar Mar 15 '18 08:03 svettwer

These stack traces appear in logs when web socket sessions start closing by Idle Timeout. Just for more clear picture.

ERROR c.c.c.w.h.CitrusWebSocketHandler  - WebSocket transport error (8) 
java.net.SocketTimeoutException: Timeout on Read
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onReadTimeout(AbstractWebSocketConnection.java:473)
	at org.eclipse.jetty.io.AbstractConnection.onFillInterestedFailed(AbstractConnection.java:170)
	at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillInterestedFailed(AbstractWebSocketConnection.java:419)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.failed(AbstractConnection.java:285)
	at org.eclipse.jetty.io.FillInterest.onFail(FillInterest.java:134)
	at org.eclipse.jetty.io.AbstractEndPoint.onIdleExpired(AbstractEndPoint.java:398)
	at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
	at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

natasha4 avatar Mar 15 '18 23:03 natasha4