[ObjC] log when got GRPC_QUEUE_TIMEOUT event from completion queue (#36095)

This is for the tat task app sometimes crash with "Unrecognized completion type".
However in obj-c wrapper, it is calling grpc_completion_queue_next with gpr_inf_future where it should never receive a timeout event.
This PR add a log and reschedule another grpc_completion_queue_next for a GRPC_OP_COMPLETE or GRPC_QUEUE_SHUTDOWN event, which is similar to the [gRPC C++ implementation](https://github.com/grpc/grpc/blob/v1.62.1/src/cpp/common/completion_queue_cc.cc#L80-L85)

Closes #36095

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36095 from HannahShiSFB:no-throw-on-completion-queue-timeout e6eaf2f18a
PiperOrigin-RevId: 627524702
pull/36290/head
Hannah Shi 11 months ago committed by Copybara-Service
parent a08a2f8300
commit d2cb5c3550
  1. 3
      src/objective-c/GRPCClient/private/GRPCCore/GRPCCompletionQueue.mm

@ -69,6 +69,9 @@ const grpc_completion_queue_attributes kCompletionQueueAttr = {
case GRPC_QUEUE_SHUTDOWN:
grpc_completion_queue_destroy(unmanagedQueue);
return;
case GRPC_QUEUE_TIMEOUT:
NSLog(@"GRPC_QUEUE_TIMEOUT, success: %d, tag: %p", event.success, event.tag);
break;
default:
[NSException raise:@"Unrecognized completion type" format:@""];
}

Loading…
Cancel
Save