Skip to content

Commit

Permalink
Apply the same fix to on_grpc_receiving_trailing_metadata() too
Browse files Browse the repository at this point in the history
Signed-off-by: erikness-doordash <[email protected]>
  • Loading branch information
erikness-doordash committed Oct 19, 2023
1 parent abfec5d commit aeaa5db
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,17 @@ impl Dispatcher {
}

fn on_grpc_receive_trailing_metadata(&self, token_id: u32, trailers: u32) {
let context_id = *self
.grpc_streams
.borrow_mut()
.get(&token_id)
.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,
None => {
// TODO: change back to a panic once underlying issue is fixed.
trace!("on_grpc_receive_initial_metadata: invalid token_id");
return;
}
};

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

0 comments on commit aeaa5db

Please sign in to comment.