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

fix: Update to tokio 1.0 #909

Merged
merged 11 commits into from
Feb 22, 2021
Merged

fix: Update to tokio 1.0 #909

merged 11 commits into from
Feb 22, 2021

Conversation

untitaker
Copy link
Member

@untitaker untitaker commented Jan 13, 2021

Also enable trust-dns for reqwest client.

The tokio upgrade brought a few transitive dependency updates,
specifically syn that then broke enumset. I updated enumset to a
fork that contains the fix. The fork is from the wasmer team, so seems
trustworthy enough.
enumset has been released and it's no longer necessary

#skip-changelog

Also enable trust-dns for reqwest client.

The tokio upgrade brought a few transitive dependency updates,
specifically `syn` that then broke `enumset`. I updated enumset to a
fork that contains the fix. The fork is from the wasmer team, so seems
trustworthy enough.
@untitaker untitaker requested a review from a team January 13, 2021 13:04
@@ -14,7 +14,8 @@ chrono = { version = "0.4.11", features = ["serde"] }
cookie = { version = "0.12.0", features = ["percent-encode"] }
debugid = { version = "0.7.2", features = ["serde"] }
dynfmt = { version = "0.1.4", features = ["python", "curly"] }
enumset = "1.0.1"
# TODO: Move back to enumset once https://github.com/Lymia/enumset/pull/18 is merged
wasmer_enumset = { version = "1.0.1" }
Copy link
Member

Choose a reason for hiding this comment

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

might as well define an alias so you minimize the diff in the code

Copy link
Member Author

Choose a reason for hiding this comment

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

the auto-derive has the crate name hardcoded so it doesn't actually work.

Copy link
Member

Choose a reason for hiding this comment

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

Enumset 1.0.3 has been released which should contain the fix.

Comment on lines +416 to +417
name = "bytes"
version = "1.0.0"
Copy link
Member

Choose a reason for hiding this comment

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

might be a good idea to also check/update all other dependencies. since this now includes 0.4, 0.5 and 1

Copy link
Member Author

Choose a reason for hiding this comment

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

this comes from multiple tokio versions which comes from multiple hyper versions which comes from multiple reqwest versions

we can update sentry sdk to fix this but I would do that in a separate PR

Copy link
Member

Choose a reason for hiding this comment

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

We can't, since we mostly have to deal with the bytes we get from actix, which is still on 0.4. We can only resolve this once we upgrade the web layer.

Cargo.lock Outdated Show resolved Hide resolved
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.

@Swatinem it would be nice to create a timely release of the Rust SDK with new reqwest/hyper.

@@ -402,6 +402,7 @@ impl UpstreamRelay {
.connect_timeout(config.http_connection_timeout())
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed that you have rt-multi-thread enabled. This means that the runtime you create here is multi threaded, as opposed to the single thread that the actix client runs in. Can you restrict this to a single thread and test throughput?

While it makes sense to eventually multi-thread, let's please stick to the proven behavior so that upstream connections to not compete with event processors for resources.

Copy link
Member

Choose a reason for hiding this comment

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

In Symbolicator we do this, although in Relay we should be able to run with just the current_thread scheduler, too.

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're right. I wanted to preserve tokio 0.x behavior but actually the default ::new() was single-threaded in 0.x. So I committed your suggestion.

I cannot explain it but current_thread yields 503 in the healthcheck in tests. I believe it blocks the wrong thread for too long.

Based on that I believe it would be safest to defer merge of this PR until after the OSS release. The OSS release should get by fine with getaddrinfo DNS resolution and old tokio.

Copy link
Member

Choose a reason for hiding this comment

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

reqwest internally likely needs blocking I/O, so use rt-multi-thread and spawn with a single worker thread. This works in symbolicator and will preserve behavior.

@Swatinem
Copy link
Member

it would be nice to create a timely release of the Rust SDK with new reqwest/hyper.

done. Please update ;-)

@@ -57,15 +57,15 @@ relay-general = { path = "../relay-general" }
relay-log = { path = "../relay-log" }
relay-quotas = { path = "../relay-quotas" }
relay-redis = { path = "../relay-redis" }
reqwest = { version = "0.10.8", features = ["gzip", "stream"] }
reqwest = { version = "0.11.0", features = ["gzip", "stream", "trust-dns"] }
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 upgrade to 0.11.1 to get some of the proxy fixes in.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup

Copy link
Member Author

Choose a reason for hiding this comment

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

ran into native-tls issue here: seanmonstar/reqwest#1181

@untitaker untitaker merged commit 4409c27 into master Feb 22, 2021
@untitaker untitaker deleted the fix/tokio-update branch February 22, 2021 16:13
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