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

FlakyTest: CancellationTest - Improve close handling #1404

Merged
merged 5 commits into from
Apr 5, 2021

Conversation

tkountis
Copy link
Contributor

@tkountis tkountis commented Mar 4, 2021

Motivation:
The EntityInputStream is not thread safe, and the cancellation is triggering a close from any thread, while the access path is through the offloaded thread.

Modifications:
Extend the ContainerRequest to capture close and handoff it to the offloaded thread if a read is already in progress, or close it atomically otherwise.

Result:
Better thread visibility and serialization of events in case of a read is in progress.

Fixes: #999

@tkountis tkountis self-assigned this Mar 4, 2021
@tkountis tkountis force-pushed the impr/cancellationtest-capture-stack branch from c8beae1 to 60ee945 Compare March 4, 2021 14:33
@tkountis tkountis changed the title CancellationTest capture stacktrace when stream is closed FlakyTest: CancellationTest capture stacktrace when stream is closed Mar 4, 2021
@tkountis tkountis changed the title FlakyTest: CancellationTest capture stacktrace when stream is closed FlakyTest: CancellationTest capture stacktrace upon closed stream Mar 4, 2021
@tkountis tkountis force-pushed the impr/cancellationtest-capture-stack branch 3 times, most recently from 82a2381 to 1c27d2d Compare March 4, 2021 15:06
@tkountis tkountis force-pushed the impr/cancellationtest-capture-stack branch from 1c27d2d to e39accf Compare March 24, 2021 13:00
@tkountis tkountis force-pushed the impr/cancellationtest-capture-stack branch from e39accf to aa23a19 Compare March 24, 2021 13:02
@tkountis tkountis requested review from Scottmitch and bondolo March 24, 2021 13:02
@tkountis tkountis changed the title FlakyTest: CancellationTest capture stacktrace upon closed stream FlakyTest: CancellationTest - Improve close handling Mar 24, 2021

@Override
public boolean hasEntity() {
if (state == State.CLOSED) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Best effort.

@tkountis tkountis force-pushed the impr/cancellationtest-capture-stack branch from 1c8e8e1 to 27e12f6 Compare April 1, 2021 14:24
Copy link
Contributor

@bondolo bondolo left a comment

Choose a reason for hiding this comment

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

Looks OK to me but not confident to approve

@tkountis
Copy link
Contributor Author

tkountis commented Apr 1, 2021

Build failure attributed to #1467

@tkountis tkountis merged commit 0372955 into apple:main Apr 5, 2021
@tkountis tkountis deleted the impr/cancellationtest-capture-stack branch April 5, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: io.servicetalk.http.router.jersey.CancellationTest.cancelRsStreams
4 participants