File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
crates/store/re_server/src
tests/rust/re_integration_test/src Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -647,6 +647,7 @@ iter_on_empty_collections = "warn"
647
647
iter_on_single_items = " warn"
648
648
iter_without_into_iter = " warn"
649
649
large_digit_groups = " warn"
650
+ large_futures = " warn"
650
651
large_include_file = " warn"
651
652
large_stack_arrays = " warn"
652
653
large_stack_frames = " warn"
@@ -738,6 +739,7 @@ unnecessary_semicolon = "warn"
738
739
unnecessary_struct_initialization = " warn"
739
740
unnecessary_wraps = " warn"
740
741
unnested_or_patterns = " warn"
742
+ unused_async = " warn"
741
743
unused_peekable = " warn"
742
744
unused_rounding = " warn"
743
745
unused_self = " warn"
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub struct Server {
39
39
/// `ServerHandle` is a tiny helper abstraction that enables us to
40
40
/// deal with the gRPC server lifecycle more easily.
41
41
pub struct ServerHandle {
42
- shutdown : Sender < ( ) > ,
42
+ shutdown : Option < Sender < ( ) > > ,
43
43
ready : mpsc:: Receiver < SocketAddr > ,
44
44
failed : mpsc:: Receiver < String > ,
45
45
}
@@ -73,9 +73,12 @@ impl ServerHandle {
73
73
self . failed . recv ( ) . await ;
74
74
}
75
75
76
- /// Signal to the gRPC server to shutdown.
77
- pub async fn shutdown ( self ) {
78
- let _ = self . shutdown . send ( ( ) ) ;
76
+ /// Signal to the gRPC server to shutdown, and then wait for it.
77
+ pub async fn shutdown_and_wait ( mut self ) {
78
+ if let Some ( shutdown) = self . shutdown . take ( ) {
79
+ shutdown. send ( ( ) ) . ok ( ) ;
80
+ self . wait_for_shutdown ( ) . await ;
81
+ }
79
82
}
80
83
}
81
84
@@ -151,7 +154,7 @@ impl Server {
151
154
} ) ;
152
155
153
156
ServerHandle {
154
- shutdown : shutdown_tx,
157
+ shutdown : Some ( shutdown_tx) ,
155
158
ready : ready_rx,
156
159
failed : failed_rx,
157
160
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl Drop for TestServer {
70
70
. expect ( "Server handle not initialized" ) ;
71
71
tokio:: task:: block_in_place ( move || {
72
72
tokio:: runtime:: Handle :: current ( ) . block_on ( async move {
73
- server_handle. shutdown ( ) . await ;
73
+ server_handle. shutdown_and_wait ( ) . await ;
74
74
} ) ;
75
75
} ) ;
76
76
}
You can’t perform that action at this time.
0 commit comments