File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -428,11 +428,17 @@ impl Dispatcher {
428
428
}
429
429
430
430
fn on_grpc_receive_initial_metadata ( & self , token_id : u32 , headers : u32 ) {
431
- let context_id = * self
432
- . grpc_streams
433
- . borrow_mut ( )
434
- . get ( & token_id)
435
- . expect ( "invalid token_id" ) ;
431
+ let grpc_streams_ref = self . grpc_streams . borrow_mut ( ) ;
432
+ let context_id_hash_slot = grpc_streams_ref
433
+ . get ( & token_id) ;
434
+ let context_id = match context_id_hash_slot {
435
+ Some ( id) => * id,
436
+ None => {
437
+ // TODO: change back to a panic once underlying issue is fixed.
438
+ trace ! ( "on_grpc_receive_initial_metadata: invalid token_id" ) ;
439
+ return ;
440
+ }
441
+ } ;
436
442
437
443
if let Some ( http_stream) = self . http_streams . borrow_mut ( ) . get_mut ( & context_id) {
438
444
self . active_id . set ( context_id) ;
You can’t perform that action at this time.
0 commit comments