We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abfec5d commit aeaa5dbCopy full SHA for aeaa5db
src/dispatcher.rs
@@ -491,11 +491,17 @@ impl Dispatcher {
491
}
492
493
fn on_grpc_receive_trailing_metadata(&self, token_id: u32, trailers: u32) {
494
- let context_id = *self
495
- .grpc_streams
496
- .borrow_mut()
497
- .get(&token_id)
498
- .expect("invalid token_id");
+ let grpc_streams_ref = self.grpc_streams.borrow_mut();
+ let context_id_hash_slot = grpc_streams_ref
+ .get(&token_id);
+ let context_id = match context_id_hash_slot {
+ Some(id) => *id,
499
+ None => {
500
+ // TODO: change back to a panic once underlying issue is fixed.
501
+ trace!("on_grpc_receive_initial_metadata: invalid token_id");
502
+ return;
503
+ }
504
+ };
505
506
if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) {
507
self.active_id.set(context_id);
0 commit comments