Summary: | WebSocket Endpoint onClose method not called when channel closed by thread interruption | ||
---|---|---|---|
Product: | Tomcat 8 | Reporter: | Kenneth Gendron <kenneth.gendron> |
Component: | WebSocket | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.0.x-trunk | ||
Target Milestone: | ---- | ||
Hardware: | All | ||
OS: | All |
Description
Kenneth Gendron
2014-01-19 10:56:23 UTC
Do you have some unit tests or some sample code to demonstrate the problem? I've been looking at the WebSocket code and (by tweaking a unit tests an using a few break points) I can create a situation where the server times out trying to write a WebSocket message to the client. The behavior in this case should be the same as if the thread waiting for the write to complete was interrupted. I see the onError() call to the Endpoint but the connection is not closed. That does not seem right to me. Generally any call to onError() should be followed by the closure of the session unless we are sure that the situation is recoverable (and the nature of the protocol is that it almost certainly is not recoverable). There are a few things I still want to check but I should be in a position to apply the fix for this tomorrow. Thank you very much. This has been fixed in 8.0.x for 8.0.0 onwards and in 7.0.x for 7.0.51 onwards. |