Closed omolenkamp closed 3 years ago
This is really wired because in this line it is impossible to get a NullPointerException in the current version and git blame shows no changes since Feb 13, 2018 (that was when the Project was imported to git).
Is it possible, and it does happen.
The if's above these lines leave encodedBuffer null in a number of cases, in this case when httpHeader.isCommitted() returns true, isHeader is false and contentBuffer.hasRemaining() returns false.
But when encodedBuffer is null the assertion (in line 257) will fail and will throw an AssertionError right? So how would line 258 be executed?
Assertions in Java don't do anything unless specifically enabled.
When using AJP between an Apache webserver and GlassFish, GlassFish throws a NullPointerException after writing the response chunks for a request, instead of sending an AJP END_RESPONSE packet. This only happens when the response body is larger than 8192 bytes.
Increasing the send buffer size of the AJP listener (which defaults to 8192 bytes) doesn't make any difference.
I reported this as a GlassFish bug two years ago (https://github.com/eclipse-ee4j/glassfish/issues/22295), but nothing was even done with my report. Because it's possible to work around the bug by patching Grizzly, I'm reporting the bug here. (even though I'm not sure it's in fact a bug in Grizzly; it's also possible that GlassFish is using Grizzly in a way it shouldn't)