You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/01/19 11:56:23 UTC

[Bug 56032] New: WebSocket Endpoint onClose method not called when channel closed by thread interruption

https://issues.apache.org/bugzilla/show_bug.cgi?id=56032

            Bug ID: 56032
           Summary: WebSocket Endpoint onClose method not called when
                    channel closed by thread interruption
           Product: Tomcat 8
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: kenneth.gendron@gmail.com

When an interrupted thread uses the basic or asynchronous remote of a session
to write, the underlying channel is closed (this is as expected); however, the
onClose method of the associated endpoint is not called.  This can lead the
server into believing the session is still active.  The only way I have gotten
around it is to delegate the write methods to6 a thread that can't possibly be
interrupted.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56032] WebSocket Endpoint onClose method not called when channel closed by thread interruption

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56032

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Do you have some unit tests or some sample code to demonstrate the problem?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56032] WebSocket Endpoint onClose method not called when channel closed by thread interruption

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56032

--- Comment #3 from Kenneth Gendron <ke...@gmail.com> ---
Thank you very much.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56032] WebSocket Endpoint onClose method not called when channel closed by thread interruption

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56032

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56032] WebSocket Endpoint onClose method not called when channel closed by thread interruption

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56032

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
This has been fixed in 8.0.x for 8.0.0 onwards and in 7.0.x for 7.0.51 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org