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 2020/11/30 06:27:56 UTC

[Bug 64944] New: Incorrect bytesSent metric when compression is enabled

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

            Bug ID: 64944
           Summary: Incorrect bytesSent metric when compression is enabled
           Product: Tomcat 9
           Version: 9.0.39
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: chenrui@gmail.com
  Target Milestone: -----

I'm using Spring Boot 2.2.11 with Tomcat 9.0.39. I found when compression is
enabled, the bytesSent metric exposed by org.apache.coyote.RequestGroupInfo is
always 0. Those metrics are exposed in JMX as well.

I believe the issue is caused by
org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(ByteBuffer)
implementation. It doesn't change the chunk parameter position in this code
branch:

    if (chunk.hasArray()) {
        compressionStream.write(chunk.array(), chunk.arrayOffset() + 
chunk.position(), len);
    } 

So org.apache.coyote.Response.doWrite(ByteBuffer) method will not be able to
update contentWritten correctly:

    contentWritten += len - chunk.remaining();

-- 
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 64944] Incorrect bytesSent metric when compression is enabled

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

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

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

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report and the analysis.

Fixed in:
- 10.0.x for 10.0.0-M11 onwards
- 9.0.x for 9.0.41 onwards
- 8.5.x for 8.5.61 onwards

7.0.x was not affected.

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