Skip to content

Infinite timeoutAsync() loop in WsHttpUpgradeHandler #436

@Andrea-Villa-Cefriel

Description

@Andrea-Villa-Cefriel

On one of the servers (version 2.0.29) we found an inifinite loop in the red5.log files, where several web socket sessions are reporting the error below every one second:

23:59:59.185 Catalina-utility-1 [WARN ] WsHttpUpgradeHandler             - null
java.lang.IllegalStateException: The WebSocket session [1260] has been closed and no method (apart from close()) may be called on a closed session
	at org.apache.tomcat.websocket.WsSession.checkState(WsSession.java:1042)
	at org.apache.tomcat.websocket.**WsSession.getUserProperties**(WsSession.java:950)
	**at org.red5.net.websocket.server.WsHttpUpgradeHandler.timeoutAsync(WsHttpUpgradeHandler.java:337)** 
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.timeoutAsync(UpgradeProcessorInternal.java:84)
	at org.apache.coyote.AbstractProtocol.lambda$startAsyncTimeout$0(AbstractProtocol.java:666)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:57)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Setting wsSession = null in the catch block may be enough to break the loop at the next iteration. Unfortunately we do not know yet how to reproduce the problem. Will keep you posted if we discover new information.

Kind regards,
Andrea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions