diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-28 18:50:24 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-28 18:50:24 +0900 |
| commit | da6dc375d679d302e379214564913aee7ba6f722 (patch) | |
| tree | da57c376d065c239507d0d542f1f0bb3194977af /Cargo.lock | |
| parent | 1b2473fd155b88c8aa90aaa844d183af617b6e8a (diff) | |
| download | php-shirabe-da6dc375d679d302e379214564913aee7ba6f722.tar.gz php-shirabe-da6dc375d679d302e379214564913aee7ba6f722.tar.zst php-shirabe-da6dc375d679d302e379214564913aee7ba6f722.zip | |
fix(http): avoid nested tokio runtime panic in download path
The CurlDownloader owned a tokio runtime and block_on'd reqwest from its
sync tick(), while the repository/installer/downloader sync bridges each
created another Runtime and block_on'd async fns that reach that leaf.
Driving one Runtime::block_on from within another panics with "Cannot
start a runtime from within a runtime", hit by `require` when fetching
p2 metadata.
Switch CurlDownloader to a blocking reqwest client (its own internal
thread, never nested) and replace the per-call Runtime::new().block_on
bridges with a no-reactor sync_executor::block_on helper. No awaited
future parks on a reactor once the only async I/O is blocking, so the
helper can be nested freely.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'Cargo.lock')
| -rw-r--r-- | Cargo.lock | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -569,6 +569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -589,6 +590,12 @@ dependencies = [ ] [[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] name = "futures-sink" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -607,7 +614,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-core", + "futures-io", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "slab", ] @@ -1653,7 +1663,9 @@ dependencies = [ "base64", "bytes", "encoding_rs", + "futures-channel", "futures-core", + "futures-util", "h2", "http", "http-body", |
