Bug 61660 - Calling flush() on servlet response print writer while compression is enabled produces corrupted response
Summary: Calling flush() on servlet response print writer while compression is enabled...
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.82
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 61866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-10-24 13:04 UTC by Ayman Madkour
Modified: 2017-12-06 17:01 UTC (History)
1 user (show)



Attachments
A sample servlet code to reproduce the issue (7.71 KB, text/plain)
2017-10-24 13:04 UTC, Ayman Madkour
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ayman Madkour 2017-10-24 13:04:48 UTC
Created attachment 35453 [details]
A sample servlet code to reproduce the issue

The issue happens only on Oracle JDK 8 update 151/152, not before.

Calling flush() on servlet response print writer while compression is enabled produces corrupted response.

See attached servlet.
Comment 1 Remy Maucherat 2017-10-24 13:14:23 UTC
As a side note, without looking at the merits of the BZ, I'd like to point out that the very common habit of doing flush and/or close at the end of a servlet is a bad idea, it may impair better error processing and will always degrade performance.
Comment 2 Mark Thomas 2017-10-24 19:57:48 UTC
This is a know issue with the JRE and will fixed in the next JRE release.

https://bugs.openjdk.java.net/browse/JDK-8189788
Comment 3 Mark Thomas 2017-12-06 17:01:24 UTC
*** Bug 61866 has been marked as a duplicate of this bug. ***