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
[B-03499] update tokio to 0.3 #461
Conversation
async fn kvbuf_scratch_and_persistence() -> DatabaseResult<()> { | ||
let test_env = test_cell_env(); | ||
let arc = test_env.env(); | ||
let arc = test_env.env(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why didn't our ci linting code catch this? is this file not being scanned or something?
tokio-tungstenite = { version = "0.10.1", features = [ "tls" ] } | ||
tokio = { version = "0.3.3", features = [ "full" ] } | ||
# No tokio 0.3 compatible release yet: https://github.com/snapview/tokio-tungstenite/issues/130 | ||
tokio-tungstenite = { git = "https://github.com/snapview/tokio-tungstenite.git", rev = "3c6d4280d77fdff3e25f68ad703d94e89f38dae2", features = [ "tls" ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oo, sneaky - good thing we're not publishing to crates.io yet...
// TODO(steveeJ): investigate whether we need an alternative | ||
// socket.set_keepalive(Some(std::time::Duration::from_secs( | ||
// config.tcp_keepalive_s as u64, | ||
// )))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we really need to, we can use net2 https://docs.rs/net2/0.2.35/net2/trait.TcpStreamExt.html#tymethod.set_keepalive_ms to build a std tcp socket, then wrap it in tokio with https://docs.rs/tokio/0.3.3/tokio/net/struct.TcpStream.html#method.from_std
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, I guess that won't work for the incoming side...
bccec02
to
f2df0fe
Compare
crates/tokio_helper/src/lib.rs
Outdated
lazy_static::lazy_static! { | ||
pub static ref TOKIO: Runtime = { | ||
new_runtime() | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lazy_static::lazy_static! { | |
pub static ref TOKIO: Runtime = { | |
new_runtime() | |
}; | |
} | |
use once_cell::sync::Lazy; | |
pub static TOKIO: Lazy<Runtime> = Lazy::new(new_runtime); |
once_cell is the new lazy_static! : )
f3568b5
to
eed77e4
Compare
This updates the tokio dependency in all crates to tokio 0.3. The update approach is as mechanical as possible, i.e. it's trying to purely adapt to the changes introduced in tokio 0.3 without unrelated refactors. These out-of-repo dependencies were updated to tokio 0.3 in the process as well: tokio 0.3 compatible versions: * tokio_safe_block_on: * lair A new crate `tokio_helper` was introduced to work around issues with the `updated tokio_safe_block_on`. It provies functionality to use a globally and statically available tokio runtime to be entered from anywhere blocking calls are required. Currently this work is blocked on two dependencies that haven't updated to tokio 0.3 yet: * quinn: used by the `transoprt_quic` crate * reqwest
This update is as mechanical as possible, i.e. it's trying to purely
adapt to the changes introduced in tokio 0.3 without unrelated
refactors.
Dependencies that need to update to tokio 0.3 before we can cleanly move forward with this:
tokio
to 1.0 seanmonstar/reqwest#1060