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

ref: Remove actix-web client, make reqwest the new http client #938

Merged
merged 3 commits into from
Feb 24, 2021

Conversation

untitaker
Copy link
Member

Remove any use of actix-web's HTTP client. We still need to clean up error types and remove unnecessary abstractions, but this should alleviate most of the pain that comes from having to support two http client implementations. We should do the real refactor in a follow-up so as to not introduce accidental behavior changes new error grouping.

@untitaker untitaker requested a review from a team February 24, 2021 10:53
Copy link
Contributor

@RaduW RaduW left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM. A few more local simplifications suggested below.

CHANGELOG.md Outdated
@@ -2,6 +2,10 @@

## Unreleased

**Features**:

- Relay now picks up HTTP proxies from environment variables. This is made possible by switching to a different HTTP client library. The undocumented `http._client` option has been removed. ([#938](https://github.com/getsentry/relay/pull/938))
Copy link
Member

Choose a reason for hiding this comment

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

Let's move the bit about the undocumented option to **Internal**.

None => {
let mut builder = ClientRequest::build();
builder.method(request.method.clone()).uri(uri);
let mut builder = {
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a redundant scope -- can you get rid of it?


Box::new(future) as Box<dyn Future<Item = _, Error = _>>
}
let future = {
Copy link
Member

Choose a reason for hiding this comment

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

This is a redundant scope, again.

.flatten()
.map(Response);

Box::new(future) as Box<dyn Future<Item = _, Error = _>>
Copy link
Member

Choose a reason for hiding this comment

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

Can get rid of the boxing.

// keep it enabled.
//
// Essentially this means that content negotiation is done twice, and the response
// body is first decompressed by reqwest, then re-compressed by actix-web.
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep the two lines of this comment somewhere? This is good insight, yet it is not apparent from the code alone.

}
}
.boxed_local()
Copy link
Member

Choose a reason for hiding this comment

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

Is this boxed_local actually required if you box the compat future? Same below.

Copy link
Member Author

Choose a reason for hiding this comment

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

you need to produce an Unpin type to call compat(), and the way to do so is to box the future. I don't really understand how that makes sense tbh but that is what the type constraints are.

)
.boxed_local()
.compat(),
) as Box<dyn Future<Item = _, Error = _>>
Copy link
Member

Choose a reason for hiding this comment

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

The cast here is redundant.

@untitaker untitaker merged commit 5aa8930 into master Feb 24, 2021
@untitaker untitaker deleted the ref/remove-awc branch February 24, 2021 15:00
untitaker added a commit to getsentry/self-hosted that referenced this pull request Feb 24, 2021
As per getsentry/relay#938 this option no longer
exists. Existing values will be ignored, however.
untitaker added a commit to getsentry/self-hosted that referenced this pull request Feb 24, 2021
As per getsentry/relay#938 this option no longer
exists. Existing values will be ignored, however.
jan-auer added a commit that referenced this pull request Feb 26, 2021
* master: (23 commits)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
  build: drop python 2.7 support (#929)
  feat(protocol): Add snapshot to the stack trace interface (#927)
  test: Improve integration tests to reduce flakyness (#928)
  fix: Ignore false-positive lints from Clippy 1.50 (#926)
  feat(protocol): Add NSError to mechanism (#925)
  meta: Fix changelog
  meta(readme): Document development config for processing mode (#921)
  ...
jan-auer added a commit that referenced this pull request Feb 26, 2021
* master: (42 commits)
  build: Switch to vendored openssl build (#914)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
  build: drop python 2.7 support (#929)
  feat(protocol): Add snapshot to the stack trace interface (#927)
  test: Improve integration tests to reduce flakyness (#928)
  fix: Ignore false-positive lints from Clippy 1.50 (#926)
  feat(protocol): Add NSError to mechanism (#925)
  meta: Fix changelog
  ...
jan-auer added a commit that referenced this pull request Feb 26, 2021
* master: (120 commits)
  fix(protocol): Deny backslashes in release names (#904)
  ref(server): Extract dynamic sampling functionality into own crate (#940)
  build: Switch to vendored openssl build (#914)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
  build: drop python 2.7 support (#929)
  feat(protocol): Add snapshot to the stack trace interface (#927)
  test: Improve integration tests to reduce flakyness (#928)
  fix: Ignore false-positive lints from Clippy 1.50 (#926)
  ...
jan-auer added a commit that referenced this pull request Feb 26, 2021
* master:
  test(general): Introduce macros for traversing Annotated (#826)
  fix(protocol): Deny backslashes in release names (#904)
  ref(server): Extract dynamic sampling functionality into own crate (#940)
  build: Switch to vendored openssl build (#914)
  feat(server): Add inbound filters functionality to dynamic sampling (#920)
  fix rule generation to new format (in tests) (#939)
  ref: Remove actix-web client, make reqwest the new http client (#938)
  fix(server): Reject empty envelopes with an explicit error (#937)
  fix(server): Ensure outcome data categories are numeric (#936)
  feat(stats): Add data category to TrackOutcome (#931)
  fix(pii): Make username pii-strippable (#935)
  build: Bump symbolic to 8.0.4 (#899)
  fix: Update to tokio 1.0 (#909)
  fix(pii): Make and/or work correctly with pii=maybe (#932)
  release: 21.2.0
  release: 0.8.3
  fix(build): Fix path to 3.7 (#930)
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