mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
Revert "try async-timer 1.0.0-beta15 (still signal-based timers)"
This reverts commit c73e9e40e9.
This commit is contained in:
13
Cargo.lock
generated
13
Cargo.lock
generated
@@ -246,14 +246,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "async-timer"
|
||||
version = "1.0.0-beta.15"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d420af8e042475e58a20d91af8eda7d6528989418c03f3f527e1c3415696f70"
|
||||
checksum = "ba5fa6ed76cb2aa820707b4eb9ec46f42da9ce70b0eafab5e5e34942b38a44d5"
|
||||
dependencies = [
|
||||
"error-code",
|
||||
"libc",
|
||||
"wasm-bindgen",
|
||||
"web-time",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1932,12 +1931,6 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error-code"
|
||||
version = "3.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f"
|
||||
|
||||
[[package]]
|
||||
name = "event-listener"
|
||||
version = "2.5.3"
|
||||
|
||||
@@ -47,7 +47,7 @@ anyhow = { version = "1.0", features = ["backtrace"] }
|
||||
arc-swap = "1.6"
|
||||
async-compression = { version = "0.4.0", features = ["tokio", "gzip", "zstd"] }
|
||||
atomic-take = "1.1.0"
|
||||
async-timer = "1.0.0-beta.15"
|
||||
async-timer = "0.7.4"
|
||||
azure_core = { version = "0.19", default-features = false, features = ["enable_reqwest_rustls", "hmac_rust"] }
|
||||
azure_identity = { version = "0.19", default-features = false, features = ["enable_reqwest_rustls"] }
|
||||
azure_storage = { version = "0.19", default-features = false, features = ["enable_reqwest_rustls"] }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use anyhow::{bail, Context};
|
||||
use async_compression::tokio::write::GzipEncoder;
|
||||
use async_timer::Timer;
|
||||
use async_timer::Oneshot;
|
||||
use bytes::Buf;
|
||||
use futures::FutureExt;
|
||||
use itertools::Itertools;
|
||||
@@ -319,7 +319,7 @@ struct PageServerHandler {
|
||||
/// See [`PageServerConf::server_side_batch_timeout`]
|
||||
server_side_batch_timeout: Option<Duration>,
|
||||
|
||||
server_side_batch_timer: Pin<Box<async_timer::timer::Platform>>,
|
||||
server_side_batch_timer: Pin<Box<async_timer::oneshot::Timer>>,
|
||||
}
|
||||
|
||||
struct Carry {
|
||||
@@ -589,7 +589,9 @@ impl PageServerHandler {
|
||||
timeline_handles: TimelineHandles::new(tenant_manager),
|
||||
cancel,
|
||||
server_side_batch_timeout,
|
||||
server_side_batch_timer: Box::pin(async_timer::new_timer(Duration::from_secs(999))), // reset each iteration
|
||||
server_side_batch_timer: Box::pin(async_timer::oneshot::Timer::new(
|
||||
Duration::from_secs(999),
|
||||
)), // reset each iteration
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,7 +668,12 @@ impl PageServerHandler {
|
||||
.msg
|
||||
]));
|
||||
} else {
|
||||
self.server_side_batch_timer.restart(batch_timeout);
|
||||
std::future::poll_fn(|ctx| {
|
||||
self.server_side_batch_timer
|
||||
.restart(batch_timeout, ctx.waker());
|
||||
std::task::Poll::Ready(())
|
||||
})
|
||||
.await;
|
||||
batching_deadline_storage = Some(&mut self.server_side_batch_timer);
|
||||
Either::Right(
|
||||
batching_deadline_storage.as_mut().expect("we just set it"),
|
||||
|
||||
@@ -9,7 +9,7 @@ from fixtures.log_helper import log
|
||||
from fixtures.neon_fixtures import NeonEnvBuilder
|
||||
from fixtures.utils import humantime_to_ms
|
||||
|
||||
TARGET_RUNTIME = 5
|
||||
TARGET_RUNTIME = 60
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -18,12 +18,10 @@ TARGET_RUNTIME = 5
|
||||
# the next 4 cases demonstrate how not-batchable workloads suffer from batching timeout
|
||||
(50, None, TARGET_RUNTIME, 1, 128, "not batchable no batching"),
|
||||
(50, "10us", TARGET_RUNTIME, 1, 128, "not batchable 10us timeout"),
|
||||
(50, "20us", TARGET_RUNTIME, 1, 128, "not batchable 20us timeout"),
|
||||
(50, "1ms", TARGET_RUNTIME, 1, 128, "not batchable 1ms timeout"),
|
||||
# the next 4 cases demonstrate how batchable workloads benefit from batching
|
||||
(50, None, TARGET_RUNTIME, 100, 128, "batchable no batching"),
|
||||
(50, "10us", TARGET_RUNTIME, 100, 128, "batchable 10us timeout"),
|
||||
(50, "20us", TARGET_RUNTIME, 100, 128, "batchable 20us timeout"),
|
||||
(50, "100us", TARGET_RUNTIME, 100, 128, "batchable 100us timeout"),
|
||||
(50, "1ms", TARGET_RUNTIME, 100, 128, "batchable 1ms timeout"),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user