From 292e515936dfcd85e41378427e92759aa2f833ec Mon Sep 17 00:00:00 2001 From: "hash-worker[bot]" <180894564+hash-worker[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:03:05 +0000 Subject: [PATCH] Update Rust crate `tarpc` to v0.35.0 (#5505) Co-authored-by: hash-worker[bot] <180894564+hash-worker[bot]@users.noreply.github.com> Co-authored-by: Tim Diekmann --- Cargo.lock | 110 ++++++------------ Cargo.toml | 2 +- .../bins/cli/src/subcommand/type_fetcher.rs | 6 +- apps/hash-graph/libs/type-fetcher/Cargo.toml | 2 +- .../libs/type-fetcher/src/fetcher.rs | 2 + .../libs/type-fetcher/src/fetcher_server.rs | 1 - 6 files changed, 43 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01304fd084d..c6f56fb4c10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1883,14 +1883,14 @@ dependencies = [ [[package]] name = "educe" -version = "0.4.23" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +checksum = "e4bd92664bf78c4d3dba9b7cdafce6fa15b13ed3ed16175218196942e99168a8" dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.82", ] [[package]] @@ -1928,12 +1928,19 @@ dependencies = [ [[package]] name = "enum-ordinalize" -version = "3.1.15" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ - "num-bigint", - "num-traits", "proc-macro2", "quote", "syn 2.0.82", @@ -2480,7 +2487,7 @@ dependencies = [ "include_dir", "mime", "opentelemetry 0.26.0", - "opentelemetry_sdk 0.26.0", + "opentelemetry_sdk", "sentry", "serde", "serde_json", @@ -2489,7 +2496,7 @@ dependencies = [ "time", "tower-http", "tracing", - "tracing-opentelemetry 0.27.0", + "tracing-opentelemetry", "type-system", "utoipa", "uuid", @@ -2856,7 +2863,7 @@ dependencies = [ "error-stack", "opentelemetry 0.26.0", "opentelemetry-otlp", - "opentelemetry_sdk 0.26.0", + "opentelemetry_sdk", "sentry", "sentry-types", "tokio", @@ -2864,7 +2871,7 @@ dependencies = [ "tracing-appender", "tracing-core", "tracing-error", - "tracing-opentelemetry 0.27.0", + "tracing-opentelemetry", "tracing-subscriber", ] @@ -4715,16 +4722,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "opentelemetry" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e" -dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk 0.18.0", -] - [[package]] name = "opentelemetry" version = "0.21.0" @@ -4766,7 +4763,7 @@ dependencies = [ "http 1.1.0", "opentelemetry 0.26.0", "opentelemetry-proto", - "opentelemetry_sdk 0.26.0", + "opentelemetry_sdk", "prost 0.13.3", "thiserror", "tokio", @@ -4780,43 +4777,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9d3968ce3aefdcca5c27e3c4ea4391b37547726a70893aab52d3de95d5f8b34" dependencies = [ "opentelemetry 0.26.0", - "opentelemetry_sdk 0.26.0", + "opentelemetry_sdk", "prost 0.13.3", "tonic 0.12.3", ] [[package]] -name = "opentelemetry_api" -version = "0.18.0" +name = "opentelemetry-semantic-conventions" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c24f96e21e7acc813c7a8394ee94978929db2bcc46cf6b5014fc612bf7760c22" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite", - "thiserror", -] - -[[package]] -name = "opentelemetry_sdk" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca41c4933371b61c2a2f214bf16931499af4ec90543604ec828f7a625c09113" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "once_cell", - "opentelemetry_api", - "percent-encoding", - "rand", - "thiserror", -] +checksum = "1cefe0543875379e47eb5f1e68ff83f45cc41366a92dfd0d073d513bf68e9a05" [[package]] name = "opentelemetry_sdk" @@ -6712,15 +6682,16 @@ checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" [[package]] name = "tarpc" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f41bce44d290df0598ae4b9cd6ea7f58f651fd3aa4af1b26060c4fa32b08af7" +checksum = "14d1be17be018ebeec4c489449adb5ef227746775974c311ce79e09886ef83c7" dependencies = [ "anyhow", "fnv", "futures", "humantime", - "opentelemetry 0.18.0", + "opentelemetry 0.26.0", + "opentelemetry-semantic-conventions", "pin-project", "rand", "serde", @@ -6731,18 +6702,18 @@ dependencies = [ "tokio-serde", "tokio-util", "tracing", - "tracing-opentelemetry 0.18.0", + "tracing-opentelemetry", ] [[package]] name = "tarpc-plugins" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +checksum = "e0e3d9676af494694e11a3e367a4bfa7f6d1d5566bd0fe9aceb4aa9281122ab8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.82", ] [[package]] @@ -7171,9 +7142,9 @@ dependencies = [ [[package]] name = "tokio-serde" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +checksum = "caf600e7036b17782571dd44fa0a5cea3c82f60db5137f774a325a76a0d6852b" dependencies = [ "bytes", "educe", @@ -7491,19 +7462,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-opentelemetry" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ebb87a95ea13271332df069020513ab70bdb5637ca42d6e492dc3bbbad48de" -dependencies = [ - "once_cell", - "opentelemetry 0.18.0", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "tracing-opentelemetry" version = "0.27.0" @@ -7513,7 +7471,7 @@ dependencies = [ "js-sys", "once_cell", "opentelemetry 0.26.0", - "opentelemetry_sdk 0.26.0", + "opentelemetry_sdk", "tracing", "tracing-core", "tracing-subscriber", diff --git a/Cargo.toml b/Cargo.toml index 37cd64b171b..3065eabf261 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -198,7 +198,7 @@ similar-asserts = { version = "=1.6.0", default-features = false } supports-color = { version = "=3.0.1", default-features = false } supports-unicode = { version = "=3.0.0", default-features = false } tachyonix = { version = "=0.3.1", default-features = false } -tarpc = { version = "=0.33", default-features = false } +tarpc = { version = "=0.35.0", default-features = false } temporal-io-client = { package = "temporal-client", git = "https://github.com/temporalio/sdk-core", rev = "7e3c23f" } temporal-io-sdk-core-protos = { package = "temporal-sdk-core-protos", git = "https://github.com/temporalio/sdk-core", rev = "7e3c23f" } test-fuzz = { version = "=6.0.0", default-features = false } diff --git a/apps/hash-graph/bins/cli/src/subcommand/type_fetcher.rs b/apps/hash-graph/bins/cli/src/subcommand/type_fetcher.rs index 20ef94d5264..083342c5c3b 100644 --- a/apps/hash-graph/bins/cli/src/subcommand/type_fetcher.rs +++ b/apps/hash-graph/bins/cli/src/subcommand/type_fetcher.rs @@ -91,7 +91,11 @@ pub async fn type_fetcher(args: TypeFetcherArgs) -> Result<(), GraphError> { server .load_predefined_types() .expect("should be able to load predefined types"); - channel.execute(server.serve()) + channel + .execute(server.serve()) + .for_each(|response| async move { + tokio::spawn(response); + }) }) .buffer_unordered(255) .for_each(|()| async {}) diff --git a/apps/hash-graph/libs/type-fetcher/Cargo.toml b/apps/hash-graph/libs/type-fetcher/Cargo.toml index 05a80a962f3..3c969808b57 100644 --- a/apps/hash-graph/libs/type-fetcher/Cargo.toml +++ b/apps/hash-graph/libs/type-fetcher/Cargo.toml @@ -14,6 +14,7 @@ description = "RPC service definition to fetch external BP types" type-system = { workspace = true, public = true } # Public third-party dependencies +tarpc = { workspace = true, public = true, features = ["tokio1"] } time = { workspace = true, public = true, features = ["serde", "std"] } serde_json = { workspace = true, public = true } @@ -25,7 +26,6 @@ futures = { workspace = true } include_dir = { workspace = true, features = ["glob"] } reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } -tarpc = { workspace = true, features = ["tokio1"] } tracing = { workspace = true } [lints] diff --git a/apps/hash-graph/libs/type-fetcher/src/fetcher.rs b/apps/hash-graph/libs/type-fetcher/src/fetcher.rs index 3945df5de24..c5bfd6968d5 100644 --- a/apps/hash-graph/libs/type-fetcher/src/fetcher.rs +++ b/apps/hash-graph/libs/type-fetcher/src/fetcher.rs @@ -1,3 +1,5 @@ +#![expect(clippy::future_not_send)] + use core::{error::Error, fmt}; use serde::{Deserialize, Serialize}; diff --git a/apps/hash-graph/libs/type-fetcher/src/fetcher_server.rs b/apps/hash-graph/libs/type-fetcher/src/fetcher_server.rs index 144c6e6aa1d..bda71c04fa5 100644 --- a/apps/hash-graph/libs/type-fetcher/src/fetcher_server.rs +++ b/apps/hash-graph/libs/type-fetcher/src/fetcher_server.rs @@ -62,7 +62,6 @@ impl FetchServer { } } -#[tarpc::server] impl Fetcher for FetchServer { async fn fetch_ontology_types( self,