Hello Christopher, thank you for your help.

> On Dec 1, 2018, at 1:52, Christopher Schultz <ch...@christopherschultz.net> 
> wrote:
> 
>> I'm investigating a problem where Tomcat (7.0.92) returns a
>> response with no HTTP headers very occasionally. It happened during
>> a load test.
>> 
>> According to the captured packets by Wireshark, after Tomcat
>> receives a request it just returns only a response body. It returns
>> neither a status line nor HTTP response headers.
>> 
>> This is a screenshot of Wireshark's "Follow HTTP Stream" which is 
>> showing the problematic response:
>> https://i.stack.imgur.com/E6ttG.png
> 
> It's difficult to tell what's being shown, here. Too much has been
> redacted. It looks like both request and response are being shown, and
> the response appears to be part of a chunked response.

The problem here is that the HTTP status line and the HTTP response headers 
which should have been at before the beginning of the chunked response ("5d") 
are missing.

I'm sorry about the too much redaction but that's what I only can do due to 
security reasons.. If more information is needed in order to narrow down the 
problem, please tell me and I will do the best.

>> This is a screen shot of "TCP Stream" of the relevant part (only 
>> response): https://i.stack.imgur.com/TLKl3.png
> 
> This looks like a standard chunked response. I see no problems, there.

Actually, this screenshot shows 2 responses. There are two terminating chunk 
("0" and an empty line) there. Those 2 responses were sent from a SOAP endpoint 
and that's why there are 2 XML documents.

And the problem here is that the HTTP status line and the HTTP response headers 
are missing in the latter response.

>> In my opinion, neither an application nor a framework can make
>> Tomcat behave this way, so I'm wondering if it's a bug or something
>> of Tomcat. Do you think it can be a bug of Tomcat or is there
>> something which can make this happen? Was there a relevant change
>> of Tomcat in recent versions?
> 
> I agree that it should not be possible for an application (and a
> framework counts as "the application" in this sense) to break Tomcat's
> handling of the HTTP spec, but I don't see direct evidence of a bug,
> yet, here.
> 
> Are your samples (shown in your images) definitely showing only a
> single TCP connection, or is it possible that wireshark is merging the
> requests/responses of multiple connections together in the same log
> stream?

I believe my samples are showing only one single TCP connection because:

* They are filtered by a "tcp.stream eq xxx" condition as shown in the title 
bars in the screen shots 
* Our downstream Nginx instance (The client of our Tomcat instance) recorded 
the error "upstream sent no valid HTTP/1.0 header while reading response header 
from upstream" at that time and the error makes perfect sense concerning the 
response which has neither HTTP status line nor HTTP headers.

Speaking of a possibility of a bug, a person commented on the Stackoverflow 
question and said that there might be something in the request that possibly 
downgrades the connection to HTTP/0.9. Do you think it's possible? The comments 
can be seen from the URL below:

https://stackoverflow.com/questions/53496598/tomcat-occasionally-returns-a-response-without-http-headers#comment93976313_53552752

Best regards,
Kohei


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to