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 2012/02/03 18:57:47 UTC

DO NOT REPLY [Bug 52593] New: incorrect byeswritten log after completed async request under http1.0

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

             Bug #: 52593
           Summary: incorrect byeswritten log after completed async
                    request under http1.0
           Product: Tomcat 7
           Version: 7.0.25
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: davidw53@msn.com
        Depends on: 52547
    Classification: Unclassified


+++ This bug was initially created as a clone of Bug #52547 +++

The originally described bug #52547 is fixed.

But there is a related bug described in my 2nd comment
https://issues.apache.org/bugzilla/show_bug.cgi?id=52547#c2

--------- copy below ------------

Additionally, I think there is a "bug" in that the recycle() happens
immediatley after the nextRequest() even when keepalive is true (I can see from
an iptables log that the socket is not closed for another default 20 seconds).

See the event(...), asyncDispatch(...) and service(...) methods in
http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java

Basically response.recycle() (when called because not dealing with async part
of the request) calls outputBuffer.recycle() immediatley response processing is
finished rather than just before the socket is actually closed.

So in an http/1.1 multi request-response (without a socket close) you still get
both outputBuffer.nextRequest() and outputBuffer.recycle() called consecutvely
at the end of each completed response process.

I can see that nextRequest(), recycle() should both exist, but only if
recycle() really only happens at socket close as it's descriptive comment says.
Otherwise it would be a (very minor) optimization to remove the (nearlly always
present) duplicate calls.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52593] outputbuffer.recycle() is called immediately after response instead of at socket close

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

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

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

--- Comment #1 from Mark Thomas <ma...@apache.org> 2012-02-05 20:48:23 UTC ---
It is this way for several reasons:
- support for pipelined requests
- ensure correct recycling of objects after an error
- simpler code

Correctly determining when recycled() is required and isn't would require more
complexity to monitor connection state than the extra recycles currently used.

Further, the impact of not recycling is far worse than the impact of extra
recycling.

If there was a case where there were multiple recycle() calls and it was clear
that one or more was always unnecessary then there would be a case to remove
it. That is not the case here.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52593] outputbuffer.recycle() is called immediately after response instead of at socket close

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

--- Comment #4 from David <da...@msn.com> 2012-02-06 11:02:26 UTC ---
OK and thanks for the reply.

I can't get my head around the pipelining as I'm not using it.

So I'll defer to your greater knowledge.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52593] outputbuffer.recycle() is called immediately after response instead of at socket close

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

David <da...@msn.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|incorrect byeswritten log   |outputbuffer.recycle() is
                   |after completed async       |called immediately after
                   |request under http1.0       |response instead of at
                   |                            |socket close

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52593] outputbuffer.recycle() is called immediately after response instead of at socket close

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

--- Comment #2 from David <da...@msn.com> 2012-02-06 09:19:27 UTC ---
Just to point out - taking into account all these things - it would be simpler
(a micro optimization but clearer code) to combine outputbuffer.nextRequest() &
recycle() and always call one of them just once at the end of response
processing.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52593] outputbuffer.recycle() is called immediately after response instead of at socket close

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

--- Comment #3 from Mark Thomas <ma...@apache.org> 2012-02-06 10:03:37 UTC ---
No it wouldn't.

recycle() != nextRequest() and to support HTTP pipelining this difference is
critical.

This code is not going to be changed.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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