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

RetryingHttpRequesterFilter: drain response before mapping to exception #2391

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

RetryingHttpRequesterFilter has responseMapper feature that helps users to translate some responses into HttpResponseException. However, it doesn't drain the response payload body, which will cause connection leaks.

Modifications:

  • Drain response payload body before returning HttpResponseException;
  • Improve tests to verify connections do not leak;
  • Use assertThrows instead of fail in tests;

Result:

Connections do not leak when responseMapper feature is used.

…tion

Motivation:

`RetryingHttpRequesterFilter` has `responseMapper` feature that helps
users to translate some responses into `HttpResponseException`. However,
it doesn't drain the response payload body, which will cause connection
leaks.

Modifications:

- Drain response payload body before returning `HttpResponseException`;
- Improve tests to verify connections do not leak;
- Use `assertThrows` instead of `fail` in tests;

Result:

Connections do not leak when `responseMapper` feature is used.
@idelpivnitskiy idelpivnitskiy self-assigned this Oct 11, 2022
@idelpivnitskiy idelpivnitskiy merged commit d9d8e93 into apple:main Oct 11, 2022
@idelpivnitskiy idelpivnitskiy deleted the fix branch October 11, 2022 22:35
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.

2 participants