Compare commits

...

1 Commits

Author SHA1 Message Date
Yuchen Liang
2a386e9617 WIP
Signed-off-by: Yuchen Liang <yuchen@neon.tech>
2024-10-18 10:14:15 -04:00
3 changed files with 4 additions and 3 deletions

1
Cargo.lock generated
View File

@@ -3737,6 +3737,7 @@ dependencies = [
"sysinfo",
"tenant_size_model",
"thiserror",
"thread_local",
"tikv-jemallocator",
"tokio",
"tokio-epoll-uring",

View File

@@ -55,6 +55,7 @@ serde_with.workspace = true
sysinfo.workspace = true
tokio-tar.workspace = true
thiserror.workspace = true
thread_local = { version = "1.1" }
tikv-jemallocator.workspace = true
tokio = { workspace = true, features = ["process", "sync", "fs", "rt", "io-util", "time"] }
tokio-epoll-uring.workspace = true

View File

@@ -12,6 +12,7 @@ use tokio_util::sync::CancellationToken;
use tracing::{error, info, info_span, warn, Instrument};
use utils::backoff::{DEFAULT_BASE_BACKOFF_SECONDS, DEFAULT_MAX_BACKOFF_SECONDS};
use thread_local::ThreadLocal;
use tokio_epoll_uring::{System, SystemHandle};
use crate::virtual_file::on_fatal_io_error;
@@ -44,9 +45,7 @@ impl ThreadLocalState {
static THREAD_LOCAL_STATE_ID: AtomicU64 = AtomicU64::new(0);
thread_local! {
static THREAD_LOCAL: ThreadLocalState = ThreadLocalState::new();
}
static THREAD_LOCAL: ThreadLocal<ThreadLocalState> = ThreadLocal::new();
/// Panics if we cannot [`System::launch`].
pub async fn thread_local_system() -> Handle {