From 847d86f3880dcc3c8eaf325a22b21ec0a9d0f9b4 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Tue, 24 Dec 2024 09:42:53 -0800 Subject: [PATCH 1/2] Upgrade hyper, tonic et al only in ducks This commit is peer to #1179 and takes an alternative approach: only upgrade hyper et al in single spots in the project. This means we have a mix of different hyper versions et al but it does compile at least. This is a wretched mess. I couldn't make tower work in ducks so it's dropped -- we'll need to add load shedding and concurrency control ourselves if we want it -- and while it's cool that hyper is now a 1.0 crate I really, really don't love that we depend on a small set of 0.1 crates to get there. I don't know if I would rather just opt into axum or not, although hyper at least will be a going concern in the ecosystem with high probability. Signed-off-by: Brian L. Troutwine --- Cargo.lock | 441 ++++++++++++++++++++++---------- integration/ducks/Cargo.toml | 11 +- integration/ducks/src/main.rs | 106 +++++--- integration/shared/Cargo.toml | 6 +- integration/sheepdog/Cargo.toml | 5 +- integration/sheepdog/src/lib.rs | 8 +- 6 files changed, 394 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 435218638..486218d33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -152,7 +152,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -163,7 +163,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -195,13 +195,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "itoa", "matchit", "memchr", @@ -216,6 +216,33 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.2", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.3.4" @@ -233,6 +260,26 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -316,7 +363,7 @@ dependencies = [ "hex", "http 1.2.0", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-named-pipe", "hyper-util", "hyperlocal", @@ -382,9 +429,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.2" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "jobserver", "libc", @@ -405,9 +452,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -473,7 +520,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -527,7 +574,7 @@ dependencies = [ "clap", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -548,23 +595,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -581,9 +628,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -638,7 +685,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -659,7 +706,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -669,14 +716,15 @@ dependencies = [ "anyhow", "bytes", "entropy", - "hyper 0.14.31", + "http-body-util", + "hyper 1.5.2", + "hyper-util", "once_cell", "shared", "sketches-ddsketch 0.3.0", "tokio", "tokio-stream", - "tonic 0.9.2", - "tower 0.5.2", + "tonic 0.12.3", "tracing", "tracing-subscriber", ] @@ -753,9 +801,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fixedbitset" @@ -807,7 +855,7 @@ dependencies = [ "page_size", "pkg-config", "smallvec", - "zerocopy 0.8.12", + "zerocopy 0.8.13", ] [[package]] @@ -881,7 +929,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -916,9 +964,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb949699c3e4df3a183b1d2142cb24277057055ed23c68ed58894f76c517223" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" dependencies = [ "cfg-if", "libc", @@ -1079,11 +1127,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1166,9 +1214,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -1190,9 +1238,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -1216,7 +1264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "pin-project-lite", "tokio", @@ -1230,12 +1278,25 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.31", + "hyper 0.14.32", "pin-project-lite", "tokio", "tokio-io-timeout", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.5.2", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.10" @@ -1247,7 +1308,7 @@ dependencies = [ "futures-util", "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.5.2", "pin-project-lite", "socket2 0.5.8", "tokio", @@ -1263,7 +1324,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "pin-project-lite", "tokio", @@ -1408,7 +1469,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -1509,6 +1570,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -1526,9 +1596,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -1551,7 +1621,7 @@ dependencies = [ "heck 0.5.0", "http 0.2.12", "http-serde", - "hyper 0.14.31", + "hyper 0.14.32", "is_executable", "lading-capture", "lading-payload", @@ -1608,7 +1678,7 @@ dependencies = [ "opentelemetry-proto", "proptest", "proptest-derive", - "prost", + "prost 0.11.9", "rand", "rmp-serde", "rustc-hash", @@ -1649,9 +1719,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "linux-raw-sys" @@ -1742,7 +1812,7 @@ checksum = "b4f0c8427b39666bf970460908b213ec09b3b350f20c0c2eabcbba51704a08e6" dependencies = [ "base64 0.22.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "indexmap 2.7.0", "ipnet", @@ -1791,9 +1861,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -1833,6 +1903,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "nibble_vec" version = "0.1.0" @@ -1891,9 +1967,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -1929,7 +2005,7 @@ dependencies = [ "futures", "futures-util", "opentelemetry", - "prost", + "prost 0.11.9", "tonic 0.8.3", "tonic-build 0.8.4", ] @@ -1972,9 +2048,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.5.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65ee1f9701bf938026630b455d5315f490640234259037edb259798b3bcf85e" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" dependencies = [ "num-traits", ] @@ -2053,7 +2129,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2149,6 +2225,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.91", +] + [[package]] name = "proc-macro2" version = "1.0.92" @@ -2167,7 +2253,7 @@ dependencies = [ "bitflags 2.6.0", "hex", "procfs-core", - "rustix 0.38.41", + "rustix 0.38.42", ] [[package]] @@ -2208,7 +2294,7 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2218,7 +2304,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" +dependencies = [ + "bytes", + "prost-derive 0.13.4", ] [[package]] @@ -2229,20 +2325,40 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck 0.4.1", - "itertools", + "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", - "prettyplease", - "prost", - "prost-types", + "prettyplease 0.1.25", + "prost 0.11.9", + "prost-types 0.11.9", "regex", "syn 1.0.109", "tempfile", "which", ] +[[package]] +name = "prost-build" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0f3e5beed80eb580c68e2c600937ac2c4eedabdfd5ef1e5b7ea4f3fba84497b" +dependencies = [ + "heck 0.5.0", + "itertools 0.13.0", + "log", + "multimap 0.10.0", + "once_cell", + "petgraph", + "prettyplease 0.2.25", + "prost 0.13.4", + "prost-types 0.13.4", + "regex", + "syn 2.0.91", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.11.9" @@ -2250,19 +2366,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.91", +] + [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", +] + +[[package]] +name = "prost-types" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" +dependencies = [ + "prost 0.13.4", ] [[package]] @@ -2375,9 +2513,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -2439,7 +2577,7 @@ dependencies = [ "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "ipnet", "js-sys", @@ -2511,15 +2649,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2584,7 +2722,7 @@ checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2618,7 +2756,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2708,11 +2846,11 @@ dependencies = [ name = "shared" version = "0.1.0" dependencies = [ - "prost", + "prost 0.13.4", "serde", "serde_json", - "tonic 0.9.2", - "tonic-build 0.9.2", + "tonic 0.12.3", + "tonic-build 0.12.3", ] [[package]] @@ -2721,10 +2859,11 @@ version = "0.1.0" dependencies = [ "anyhow", "escargot", + "hyper-util", "shared", "tempfile", "tokio", - "tonic 0.9.2", + "tonic 0.12.3", "tower 0.5.2", "tracing", "tracing-subscriber", @@ -2823,9 +2962,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -2855,7 +2994,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2865,9 +3004,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.2.0", + "fastrand 2.3.0", "once_cell", - "rustix 0.38.41", + "rustix 0.38.42", "windows-sys 0.59.0", ] @@ -2897,7 +3036,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -2908,7 +3047,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3007,7 +3146,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3054,7 +3193,7 @@ checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.13.1", "bytes", "futures-core", @@ -3062,12 +3201,12 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", - "hyper-timeout", + "hyper 0.14.32", + "hyper-timeout 0.4.1", "percent-encoding", "pin-project", - "prost", - "prost-derive", + "prost 0.11.9", + "prost-derive 0.11.9", "tokio", "tokio-stream", "tokio-util", @@ -3085,7 +3224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", - "axum", + "axum 0.6.20", "base64 0.21.7", "bytes", "futures-core", @@ -3093,11 +3232,41 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", - "hyper-timeout", + "hyper 0.14.32", + "hyper-timeout 0.4.1", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.9", + "base64 0.22.1", + "bytes", + "h2 0.4.7", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.2", + "hyper-timeout 0.5.2", + "hyper-util", + "percent-encoding", + "pin-project", + "prost 0.13.4", + "socket2 0.5.8", "tokio", "tokio-stream", "tower 0.4.13", @@ -3112,24 +3281,25 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" dependencies = [ - "prettyplease", + "prettyplease 0.1.25", "proc-macro2", - "prost-build", + "prost-build 0.11.9", "quote", "syn 1.0.109", ] [[package]] name = "tonic-build" -version = "0.9.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" dependencies = [ - "prettyplease", + "prettyplease 0.2.25", "proc-macro2", - "prost-build", + "prost-build 0.13.4", + "prost-types 0.13.4", "quote", - "syn 1.0.109", + "syn 2.0.91", ] [[package]] @@ -3201,7 +3371,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3292,9 +3462,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" @@ -3410,7 +3580,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "log", "mime", "mime_guess", @@ -3436,9 +3606,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -3447,24 +3617,23 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.47" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", @@ -3475,9 +3644,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3485,28 +3654,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -3521,7 +3690,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.41", + "rustix 0.38.42", ] [[package]] @@ -3595,7 +3764,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3606,7 +3775,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3819,7 +3988,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -3835,11 +4004,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e031087b26520ba76806365896f191416ce84873ed6c6910a9ab5fe0f98f8ed3" +checksum = "67914ab451f3bfd2e69e5e9d2ef3858484e7074d63f204fd166ec391b54de21d" dependencies = [ - "zerocopy-derive 0.8.12", + "zerocopy-derive 0.8.13", ] [[package]] @@ -3850,18 +4019,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] name = "zerocopy-derive" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568244125ba0fc91ae949b97f2852f82cb1a65c3327bd68e6edadd29e67cca26" +checksum = "7988d73a4303ca289df03316bc490e934accf371af6bc745393cf3c2c5c4f25d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] @@ -3881,7 +4050,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", "synstructure", ] @@ -3904,7 +4073,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.91", ] [[package]] diff --git a/integration/ducks/Cargo.toml b/integration/ducks/Cargo.toml index f8bacd6bf..1cb604b62 100644 --- a/integration/ducks/Cargo.toml +++ b/integration/ducks/Cargo.toml @@ -11,7 +11,9 @@ publish = false anyhow = "1.0" bytes = { workspace = true } entropy = "0.4" -hyper = { workspace = true, features = ["server", "backports", "deprecated"] } +http-body-util = "0.1" +hyper = { version = "1.5", features = ["server"] } +hyper-util = "0.1" once_cell = { workspace = true } shared = { path = "../shared" } sketches-ddsketch = "0.3" @@ -26,14 +28,9 @@ tokio = { workspace = true, features = [ "net", ] } tokio-stream = { version = "0.1", features = ["net"] } -tonic = { workspace = true, default-features = false, features = [ +tonic = { version = "0.12", default-features = false, features = [ "transport", "prost", ] } -tower = { workspace = true, features = [ - "timeout", - "limit", - "load-shed", -] } tracing = { version = "0.1", features = ["std", "attributes"] } tracing-subscriber = { version = "0.3", features = ["std", "env-filter"] } diff --git a/integration/ducks/src/main.rs b/integration/ducks/src/main.rs index a93063525..c9dbdb83d 100644 --- a/integration/ducks/src/main.rs +++ b/integration/ducks/src/main.rs @@ -14,13 +14,14 @@ //! - Receive data on other protocols & formats use anyhow::Context; +use bytes::Bytes; use bytes::BytesMut; -use hyper::{ - body::HttpBody, - server::conn::{AddrIncoming, AddrStream}, - service::{make_service_fn, service_fn}, - Body, Method, Request, StatusCode, -}; +use http_body_util::Full; +use http_body_util::{combinators::BoxBody, BodyExt}; +use hyper::{service::service_fn, Method, Request, StatusCode}; +use hyper_util::rt::TokioExecutor; +use hyper_util::rt::TokioIo; +use hyper_util::server::conn::auto; use once_cell::sync::OnceCell; use shared::{ integration_api::{ @@ -32,6 +33,7 @@ use shared::{ }; use sketches_ddsketch::DDSketch; use std::{collections::HashMap, net::SocketAddr, pin::Pin, sync::Arc, time::Duration}; +use tokio::task::JoinSet; use tokio::{ io::AsyncReadExt, net::{TcpListener, TcpStream, UdpSocket, UnixListener}, @@ -39,7 +41,7 @@ use tokio::{ }; use tokio_stream::{wrappers::UnixListenerStream, Stream}; use tonic::Status; -use tower::ServiceBuilder; +use tracing::error; use tracing::{debug, trace, warn}; static HTTP_COUNTERS: OnceCell>> = OnceCell::new(); @@ -125,9 +127,14 @@ impl From<&SocketCounters> for SocketMetrics { } #[tracing::instrument(level = "trace")] -async fn http_req_handler(req: Request) -> Result, hyper::Error> { +async fn http_req_handler( + req: Request, +) -> Result>, hyper::Error> { + // Split into parts let (parts, body) = req.into_parts(); - let body = body.collect().await?.to_bytes(); + + // Convert the `Body` into `Bytes` + let body = body.boxed().collect().await?.to_bytes(); { let metric = HTTP_COUNTERS.get().expect("HTTP_COUNTERS not initialized"); @@ -143,12 +150,17 @@ async fn http_req_handler(req: Request) -> Result, h *method_counter += 1; } - let mut okay = hyper::Response::default(); - *okay.status_mut() = StatusCode::OK; + // Create a simple OK response + let mut resp = hyper::Response::default(); + *resp.status_mut() = StatusCode::OK; + *resp.body_mut() = full(body); + Ok(resp) +} - let body_bytes = vec![]; - *okay.body_mut() = Body::from(body_bytes); - Ok(okay) +fn full>(chunk: T) -> BoxBody { + Full::new(chunk.into()) + .map_err(|never| match never {}) + .boxed() } /// Tracks state for a ducks instance @@ -191,11 +203,10 @@ impl IntegrationTarget for DucksTarget { match config.listen { shared::ListenConfig::Http => { // bind to a random open TCP port - let bind_addr = SocketAddr::from(([127, 0, 0, 1], 0)); - let addr = AddrIncoming::bind(&bind_addr) - .map_err(|_e| Status::internal("unable to bind a port"))?; - let port = addr.local_addr().port() as u32; - tokio::spawn(Self::http_listen(config, addr)); + let addr = SocketAddr::from(([127, 0, 0, 1], 0)); + let listener = tokio::net::TcpListener::bind(addr).await?; + let port = listener.local_addr()?.port() as u32; + tokio::spawn(Self::http_listen(config, listener)); Ok(tonic::Response::new(ListenInfo { port })) } @@ -255,24 +266,51 @@ impl IntegrationTarget for DucksTarget { } impl DucksTarget { - async fn http_listen(_config: DucksConfig, addr: AddrIncoming) -> Result<(), anyhow::Error> { + async fn http_listen( + _config: DucksConfig, + listener: tokio::net::TcpListener, + ) -> Result<(), anyhow::Error> { debug!("HTTP listener active"); HTTP_COUNTERS.get_or_init(|| Arc::new(Mutex::new(HttpCounters::default()))); - let service = make_service_fn(|_: &AddrStream| async move { - Ok::<_, hyper::Error>(service_fn(move |request: Request| { - trace!("REQUEST: {:?}", request); - http_req_handler(request) - })) - }); - let svc = ServiceBuilder::new() - .load_shed() - .concurrency_limit(1_000) - .timeout(Duration::from_secs(1)) - .service(service); - - let server = hyper::Server::builder(addr).serve(svc); - server.await?; + let mut join_set = JoinSet::new(); + loop { + let (stream, addr) = match listener.accept().await { + Ok(x) => x, + Err(e) => { + error!("failed to accept connection: {e}"); + break; + } + }; + + let serve_connection = async move { + let result = auto::Builder::new(TokioExecutor::new()) + .serve_connection(TokioIo::new(stream), service_fn(http_req_handler)) + .await; + + if let Err(e) = result { + error!("error serving {addr}: {e}"); + } + }; + + join_set.spawn(serve_connection); + } + while (join_set.join_next().await).is_some() {} + + // let service = make_service_fn(|_: &AddrStream| async move { + // Ok::<_, hyper::Error>(service_fn(move |request: Request| { + // trace!("REQUEST: {:?}", request); + // http_req_handler(request) + // })) + // }); + // let svc = ServiceBuilder::new() + // .load_shed() + // .concurrency_limit(1_000) + // .timeout(Duration::from_secs(1)) + // .service(service); + + // let server = hyper::Server::builder(addr).serve(svc); + // server.await?; Ok(()) } diff --git a/integration/shared/Cargo.toml b/integration/shared/Cargo.toml index 4436b0c6d..aecbcd387 100644 --- a/integration/shared/Cargo.toml +++ b/integration/shared/Cargo.toml @@ -9,13 +9,13 @@ publish = false [dependencies] serde = { version = "1.0", features = ["derive"] } -tonic = { workspace = true, default-features = false, features = [ +tonic = { version = "0.12", default-features = false, features = [ "codegen", "prost", "transport", ] } -prost = "0.11" +prost = "0.13" serde_json = "1.0" [build-dependencies] -tonic-build = { version = "0.9" } +tonic-build = { version = "0.12" } diff --git a/integration/sheepdog/Cargo.toml b/integration/sheepdog/Cargo.toml index 13b6daf1f..c43c2330e 100644 --- a/integration/sheepdog/Cargo.toml +++ b/integration/sheepdog/Cargo.toml @@ -22,11 +22,12 @@ tokio = { version = "1.41", features = [ "time", "net", ] } -tonic = { workspace = true, default-features = false, features = [ +tonic = { version = "0.12", default-features = false, features = [ "transport", "prost", ] } -tower = { workspace = true, features = [ +hyper-util = "0.1" +tower = { version = "0.5", features = [ "timeout", "limit", "load-shed", diff --git a/integration/sheepdog/src/lib.rs b/integration/sheepdog/src/lib.rs index 3033c03a7..245236fec 100644 --- a/integration/sheepdog/src/lib.rs +++ b/integration/sheepdog/src/lib.rs @@ -27,6 +27,7 @@ use std::{ }; use anyhow::Context; +use hyper_util::rt::TokioIo; use shared::{ integration_api::{self, integration_target_client::IntegrationTargetClient}, DucksConfig, @@ -175,7 +176,12 @@ impl IntegrationTest { } let channel = Endpoint::try_from("http://127.0.0.1/this-is-not-used")? .connect_with_connector(tower::service_fn(move |_| { - UnixStream::connect(ducks_comm_file.clone()) + let ducks_comm_file = ducks_comm_file.clone(); + async move { + let sock = UnixStream::connect(ducks_comm_file).await?; + // Wrap the raw UnixStream in a TokioIo wrapper + Ok::<_, std::io::Error>(TokioIo::new(sock)) + } })) .await .context("Failed to connect to `ducks` integration test target binary")?; From 6d299add51461107ed647d9ef16b3ea81f34f4e6 Mon Sep 17 00:00:00 2001 From: "Brian L. Troutwine" Date: Tue, 24 Dec 2024 09:53:07 -0800 Subject: [PATCH 2/2] remove commented code Signed-off-by: Brian L. Troutwine --- integration/ducks/src/main.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/integration/ducks/src/main.rs b/integration/ducks/src/main.rs index c9dbdb83d..695bf77a3 100644 --- a/integration/ducks/src/main.rs +++ b/integration/ducks/src/main.rs @@ -297,20 +297,6 @@ impl DucksTarget { } while (join_set.join_next().await).is_some() {} - // let service = make_service_fn(|_: &AddrStream| async move { - // Ok::<_, hyper::Error>(service_fn(move |request: Request| { - // trace!("REQUEST: {:?}", request); - // http_req_handler(request) - // })) - // }); - // let svc = ServiceBuilder::new() - // .load_shed() - // .concurrency_limit(1_000) - // .timeout(Duration::from_secs(1)) - // .service(service); - - // let server = hyper::Server::builder(addr).serve(svc); - // server.await?; Ok(()) }