Skip to content

Commit abfec5d

Browse files
Change panic to trace log
Signed-off-by: erikness-doordash <[email protected]>
1 parent 6b47aec commit abfec5d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/dispatcher.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,17 @@ impl Dispatcher {
428428
}
429429

430430
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+
};
436442

437443
if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) {
438444
self.active_id.set(context_id);

0 commit comments

Comments
 (0)