@@ -169,8 +169,9 @@ static METASTORE_GRPC_CLIENT_METRICS_LAYER: Lazy<GrpcMetricsLayer> =
169
169
static METASTORE_GRPC_SERVER_METRICS_LAYER : Lazy < GrpcMetricsLayer > =
170
170
Lazy :: new ( || GrpcMetricsLayer :: new ( "metastore" , "server" ) ) ;
171
171
172
- static GRPC_TIMEOUT_LAYER : Lazy < TimeoutLayer > =
173
- Lazy :: new ( || TimeoutLayer :: new ( Duration :: from_secs ( 30 ) ) ) ;
172
+ static GRPC_INGESTER_SERVICE_TIMEOUT : Duration = Duration :: from_secs ( 30 ) ;
173
+ static GRPC_INDEXING_SERVICE_TIMEOUT : Duration = Duration :: from_secs ( 30 ) ;
174
+ static GRPC_METASTORE_SERVICE_TIMEOUT : Duration = Duration :: from_secs ( 10 ) ;
174
175
175
176
struct QuickwitServices {
176
177
pub node_config : Arc < NodeConfig > ,
@@ -459,16 +460,13 @@ pub async fn serve_quickwit(
459
460
{
460
461
bail ! ( "could not find any metastore node in the cluster" ) ;
461
462
}
462
- // These layers applies to all the RPCs of the metastore.
463
- let shared_layers = ServiceBuilder :: new ( )
464
- . layer ( RetryLayer :: new ( RetryPolicy :: from ( RetryParams :: standard ( ) ) ) )
465
- . layer ( METASTORE_GRPC_CLIENT_METRICS_LAYER . clone ( ) )
466
- . layer ( tower:: limit:: GlobalConcurrencyLimitLayer :: new (
463
+ MetastoreServiceClient :: tower ( )
464
+ . stack_layer ( TimeoutLayer :: new ( GRPC_METASTORE_SERVICE_TIMEOUT ) )
465
+ . stack_layer ( RetryLayer :: new ( RetryPolicy :: from ( RetryParams :: standard ( ) ) ) )
466
+ . stack_layer ( METASTORE_GRPC_CLIENT_METRICS_LAYER . clone ( ) )
467
+ . stack_layer ( tower:: limit:: GlobalConcurrencyLimitLayer :: new (
467
468
get_metastore_client_max_concurrency ( ) ,
468
469
) )
469
- . into_inner ( ) ;
470
- MetastoreServiceClient :: tower ( )
471
- . stack_layer ( shared_layers)
472
470
. build_from_balance_channel ( balance_channel, grpc_config. max_message_size )
473
471
} ;
474
472
// Instantiate a control plane server if the `control-plane` role is enabled on the node.
@@ -514,11 +512,11 @@ pub async fn serve_quickwit(
514
512
None
515
513
} ;
516
514
517
- // Setup indexer pool.
515
+ // Setup the indexer pool to track cluster changes .
518
516
setup_indexer_pool (
519
517
& node_config,
520
518
cluster. change_stream ( ) ,
521
- indexer_pool. clone ( ) ,
519
+ indexer_pool,
522
520
indexing_service_opt. clone ( ) ,
523
521
) ;
524
522
@@ -943,7 +941,7 @@ async fn setup_ingest_v2(
943
941
} else {
944
942
let ingester_service = IngesterServiceClient :: tower ( )
945
943
. stack_layer ( INGEST_GRPC_CLIENT_METRICS_LAYER . clone ( ) )
946
- . stack_layer ( GRPC_TIMEOUT_LAYER . clone ( ) )
944
+ . stack_layer ( TimeoutLayer :: new ( GRPC_INGESTER_SERVICE_TIMEOUT ) )
947
945
. build_from_channel (
948
946
node. grpc_advertise_addr ( ) ,
949
947
node. channel ( ) ,
@@ -1145,7 +1143,7 @@ fn setup_indexer_pool(
1145
1143
} else {
1146
1144
let client = IndexingServiceClient :: tower ( )
1147
1145
. stack_layer ( INDEXING_GRPC_CLIENT_METRICS_LAYER . clone ( ) )
1148
- . stack_layer ( GRPC_TIMEOUT_LAYER . clone ( ) )
1146
+ . stack_layer ( TimeoutLayer :: new ( GRPC_INDEXING_SERVICE_TIMEOUT ) )
1149
1147
. build_from_channel (
1150
1148
node. grpc_advertise_addr ( ) ,
1151
1149
node. channel ( ) ,
0 commit comments