mirror of https://github.com/grpc/grpc.git
[Async ExecuteBatchError Issue] Log instead of raise ExecuteBatchError in Aysncio server (#32551)
### Description When invoking a RPC, sometimes operations in core will fail which result in an `ExecuteBatchError`, currently we [simply raise this error](https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi#L705), and left this Exception unhandled in event loop with error message `Task exception was never retrieved`. ### Changes included This PR changes the behavior to log the `ExecuteBatchError` instead of raising it. This shouldn't change existing behavior because even without this change, the exception will simply left on event loop. ### Testing Tested by manually `set_expection` in [this future](https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi#L84), verified that error was logged correctly and no exception was left in event loop, sample log: ``` ERROR:grpc._cython.cygrpc:ExecuteBatchError raised in core by servicer method [/grpc.testing.TestService/UnaryCall] Traceback (most recent call last): File "src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi", line 682, in _cython.cygrpc._handle_exceptions File "src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi", line 802, in _handle_rpc File "src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi", line 547, in _handle_unary_unary_rpc File "src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi", line 452, in _finish_handler_with_unary_response File "src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi", line 106, in execute_wrong_batch _cython.cygrpc.ExecuteBatchError: Failed "execute_batch_including_SendInitialMetadataOperation": (<_cython.cygrpc.SendInitialMetadataOperation object at 0x7fa86d936ca0>, <_cython.cygrpc.SendMessageOperation object at 0x7fa86cf48cb0>, <_cython.cygrpc.SendStatusFromServerOperation object at 0x7fa86cf4c110>) ```pull/32814/head
parent
bdd1ac4d1d
commit
5452017fa4
1 changed files with 3 additions and 1 deletions
Loading…
Reference in new issue