jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Flaky test ServletTest.testSimpleIdleRead()

Open sbordet opened this issue 1 year ago • 1 comments

Jetty version(s) 12+

Jetty Environment ee10

Description See #10945.

The problem is as follows:

The last request does not send the content, so the Servlet is blocked in a read. The idle timeout fires, and runs the demand callback, which reads the failure, which wakes up the blocked by throwing, which is then caught and handled in ServletChannel.handleException(), resulting in a sendError() that succeeds.

In the process above, however, we do not notify the underlying HttpStream that there was a failure. So in case of HttpStreamOverHTTP1, the underlying EndPoint remains fill interested (because the request was waiting for content that was never sent).

When the sendError() completes successfully, HttpStreamOverHTTP1 is succeeded, where it checks if it was fill interested, finding that it was, and aborting with "read pending".

sbordet avatar Jan 26 '24 14:01 sbordet

The test also erroneously send 11 bytes of data instead of 10, due to the extra \n after the 10 digits.

sbordet avatar Jan 26 '24 15:01 sbordet