Skip to content

Commit 488375a

Browse files
authored
Fix timeout layer not working with retry layer (#5775)
* Add test that shows the problem * Fix metastore layer order * Revert "Add test that shows the problem" This reverts commit 09fc80f.
1 parent 6ec11c5 commit 488375a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

quickwit/quickwit-common/src/tower/timeout.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ where
9595
///
9696
/// If the inner service does not complete within the specified duration,
9797
/// the response will be aborted with the error `TimeoutExceeded`.
98+
///
99+
/// Note that when used in combination with a retry layer, this should be
100+
/// stacked on top of it for the timeout to be retried.
98101
#[derive(Debug, Clone)]
99102
pub struct TimeoutLayer {
100103
timeout: Duration,

quickwit/quickwit-serve/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ pub async fn serve_quickwit(
463463
bail!("could not find any metastore node in the cluster");
464464
}
465465
MetastoreServiceClient::tower()
466-
.stack_layer(TimeoutLayer::new(GRPC_METASTORE_SERVICE_TIMEOUT))
467466
.stack_layer(RetryLayer::new(RetryPolicy::from(RetryParams::standard())))
467+
.stack_layer(TimeoutLayer::new(GRPC_METASTORE_SERVICE_TIMEOUT))
468468
.stack_layer(METASTORE_GRPC_CLIENT_METRICS_LAYER.clone())
469469
.stack_layer(tower::limit::GlobalConcurrencyLimitLayer::new(
470470
get_metastore_client_max_concurrency(),

0 commit comments

Comments
 (0)