Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #9121 - Flaky BlockedWritesWithSmallThreadPoolTest.testServerThreadsBlockedInWrites(). #12178

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Aug 20, 2024

The test uncovered a larger problem detailed in the issue: the Handler Callback should be non-blocking.

Since all implementations of HttpStream are non-blocking, overridden HttpStream.getInvocationType() to return NON_BLOCKING.

This guarantees that even in case of all server threads blocked, blocked/pending writes can be completed.

…readsBlockedInWrites().

The test uncovered a larger problem detailed in the issue: the Handler Callback should be non-blocking.

Since all implementations of HttpStream are non-blocking, overridden HttpStream.getInvocationType() to return NON_BLOCKING.

This guarantees that even in case of all server threads blocked, blocked/pending writes can be completed.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet requested a review from gregw August 20, 2024 12:17
// Write a large content to cause TCP congestion.
response.write(true, ByteBuffer.wrap(new byte[contentLength]), callback);
// Blocking write a large content to cause TCP congestion.
Content.Sink.write(response, true, ByteBuffer.wrap(new byte[contentLength]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we test both async and blocking writes here?

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet requested a review from gregw August 24, 2024 14:56
@sbordet sbordet merged commit 930d915 into jetty-12.0.x Aug 26, 2024
5 of 10 checks passed
@sbordet sbordet deleted the fix/jetty-12.0.x/9121/fix-blocking-writes branch August 26, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Jetty 12 - Flaky BlockedWritesWithSmallThreadPoolTest.testServerThreadsBlockedInWrites()
2 participants