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 2023/06/28 16:18:06 UTC

[Bug 66659] Tomcat does not send FIN message upon request by client to close TCP connection

https://bz.apache.org/bugzilla/show_bug.cgi?id=66659

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
The issue is that Tomcat won't see the effects of the FIN until it tries to
read from the socket. That won't happen until Tomcat tries to read the next
request. And that will never happen as with SSE the current response
(effectively) never ends so Tomcat never gets as far as trying to read the next
request.

If Tomcat tried to read earlier then it should see the FIN and be able to act
on it but handling the results of that early read when there is pipe-lined HTTP
data is going to be "interesting".

Architecturally I'm not even sure that it is possible to fix this for HTTP/1.1.
I have a few ideas but they involve extensive low-level changes and I haven't
fully thought through the concurrency issues involved.

A simpler solution (and quicker for you to implement) should be switching to
HTTP/2. The multiplexing nature of HTTP/2 means that Tomcat is, effectively,
always trying to read the input and will see the close of either the stream or
the connection.

Switching to WebSocket is another option but one that is almost certainly
rather more work for you.

I'm leaning towards closing this as WONTFIX but I'll leave it open for now to
allow others to comment.

-- 
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