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

Properly drain failed responses in http-service-composition example #3026

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

Existing ResponseCheckingClientFilter demonstrated in servicetalk-http-service-composition maps the response to an exception, but does not drain the response payload body, leaking the connection.

Modifications:

  • Replace ResponseCheckingClientFilter with RetryingHttpRequesterFilter.Builder.requestMapper feature;
  • Rename BadResponseHandlingServiceFilter to HttpResponseExceptionHandlingServiceFilter and update it to target HttpResponseException instead of BadResponseStatusException;

Result:

We don't show users how to leak a connection :)

Motivation:

Existing `ResponseCheckingClientFilter` demonstrated in
`servicetalk-http-service-composition` maps the response to an
exception, but does not drain the response payload body, leaking the
connection.

Modifications:

- Replace `ResponseCheckingClientFilter` with
`RetryingHttpRequesterFilter.Builder.requestMapper` feature;
- Rename `BadResponseHandlingServiceFilter` to
`HttpResponseExceptionHandlingServiceFilter` and update it to target
`HttpResponseException` instead of `BadResponseStatusException`;

Result:

We don't show users how to leak a connection :)
@idelpivnitskiy idelpivnitskiy merged commit 21c0a74 into apple:main Jul 31, 2024
11 checks passed
@idelpivnitskiy idelpivnitskiy deleted the drain branch July 31, 2024 16:27
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.

3 participants