Skip to content

Commit

Permalink
Removing one task per call layer on control plane.
Browse files Browse the repository at this point in the history
They are useless. The control plane is already an actor.
  • Loading branch information
fulmicoton committed May 21, 2024
1 parent 8ee25c9 commit 913cc15
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions quickwit/quickwit-serve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,20 +331,9 @@ async fn start_control_plane_if_needed(
.await?;

let control_plane_server_opt = Some(control_plane_mailbox.clone());

// These layers apply to all the RPCs of the control plane.
let shared_layers = ServiceBuilder::new()
.layer(CP_GRPC_SERVER_METRICS_LAYER.clone())
.layer(LoadShedLayer::new(100))
.into_inner();
let control_plane_client = ControlPlaneServiceClient::tower()
.stack_layer(shared_layers)
.stack_create_index_layer(OneTaskPerCallLayer)
.stack_delete_index_layer(OneTaskPerCallLayer)
.stack_add_source_layer(OneTaskPerCallLayer)
.stack_toggle_source_layer(OneTaskPerCallLayer)
.stack_delete_source_layer(OneTaskPerCallLayer)
.stack_get_or_create_open_shards_layer(OneTaskPerCallLayer)
.stack_layer(CP_GRPC_SERVER_METRICS_LAYER.clone())
.stack_layer(LoadShedLayer::new(100))
.build_from_mailbox(control_plane_mailbox);
Ok((control_plane_server_opt, control_plane_client))
} else {
Expand Down

0 comments on commit 913cc15

Please sign in to comment.