Closed nayato closed 6 years ago
Thanks for the report. I'll take a look.
I pushed a PR to tokio
: https://github.com/tokio-rs/tokio/pull/212
With this patch, the server behaves normally. Once you confirm this, I can merge and push out a patch release fixing the issue.
Tried patching tokio to your branch but tokio-core won't compile with it (neither 0.1 nor master):
[dependencies]
...
tokio-core= { git = 'https://github.com/tokio-rs/tokio-core' }#"0.1"
[patch.crates-io]
"tokio" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
Errors are:
tokio-core-ec1bf80948dd483b\e1db2bb\src\reactor\mod.rs:306:32
|
306 | .enter(enter)
| ^^^^^ expected struct `tokio_executor::enter::Enter`, found struct `tokio_executor::Enter`
|
= note: expected type `&mut tokio_executor::enter::Enter`
found type `&mut tokio_executor::Enter`
@nayato it looks like patch has some wonky behavior w/ multiple crates in a single git repo. The following worked for me:
[patch.crates-io]
"tokio" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
"tokio-io" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
"tokio-reactor" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
"tokio-executor" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
"tokio-threadpool" = { git = 'https://github.com/carllerche/tokio.git', branch = "fix-current-thread-turn" }
Yes, patch fixes it.
Closed by tokio-rs/tokio#212
Also, I pushed a release to crates.io w/ the fix.
repro:
git clone https://github.com/nayato/length-server
cargo run
-> CPU is at 0%cargo update && cargo run
-> CPU is at 100% I'd guess it's related to recent move to reformed tokio but didn't look closer yet.