Skip to content

Commit

Permalink
Revert "Revert "switch back to tokio::time::sleep, to get the numbers""
Browse files Browse the repository at this point in the history
This reverts commit aa695b2.
  • Loading branch information
problame committed Nov 20, 2024
1 parent b299eb1 commit af95320
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ 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 = "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"] }
Expand Down
1 change: 0 additions & 1 deletion pageserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ anyhow.workspace = true
arc-swap.workspace = true
async-compression.workspace = true
async-stream.workspace = true
async-timer.workspace = true
bit_field.workspace = true
byteorder.workspace = true
bytes.workspace = true
Expand Down
17 changes: 3 additions & 14 deletions pageserver/src/page_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use anyhow::{bail, Context};
use async_compression::tokio::write::GzipEncoder;
use async_timer::Oneshot;
use bytes::Buf;
use futures::FutureExt;
use itertools::Itertools;
Expand All @@ -23,7 +22,6 @@ use pq_proto::FeStartupPacket;
use pq_proto::{BeMessage, FeMessage, RowDescriptor};
use std::borrow::Cow;
use std::io;
use std::pin::Pin;
use std::str;
use std::str::FromStr;
use std::sync::Arc;
Expand Down Expand Up @@ -318,8 +316,6 @@ struct PageServerHandler {

/// See [`PageServerConf::server_side_batch_timeout`]
server_side_batch_timeout: Option<Duration>,

server_side_batch_timer: Pin<Box<async_timer::oneshot::Timer>>,
}

struct Carry {
Expand Down Expand Up @@ -589,9 +585,6 @@ impl PageServerHandler {
timeline_handles: TimelineHandles::new(tenant_manager),
cancel,
server_side_batch_timeout,
server_side_batch_timer: Box::pin(async_timer::oneshot::Timer::new(
Duration::from_secs(999),
)), // reset each iteration
}
}

Expand Down Expand Up @@ -668,13 +661,9 @@ impl PageServerHandler {
.msg
]));
} else {
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);
batching_deadline_storage = Some(Box::pin(async move {
tokio::time::sleep(batch_timeout).await;
}));
Either::Right(
batching_deadline_storage.as_mut().expect("we just set it"),
)
Expand Down

0 comments on commit af95320

Please sign in to comment.