Suppress server stop log spamming

pull/21904/head
Lidi Zheng 5 years ago
parent f89448a9d5
commit 5a7093639f
  1. 5
      src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
  2. 2
      src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py

@ -476,6 +476,11 @@ async def _handle_exceptions(RPCState rpc_state, object rpc_coro, object loop):
except _ServerStoppedError:
_LOGGER.info('Aborting RPC due to server stop.')
except Exception as e:
if rpc_state.server._status == AIO_SERVER_STATUS_STOPPED:
if isinstance(asyncio.CancelledError, e) or isinstance(ExecuteBatchError, e):
_LOGGER.info('Aborting RPC due to server stop.')
return
_LOGGER.exception('Unexpected [%s] raised by servicer method [%s]' % (
type(e).__name__,
_decode(rpc_state.method()),

@ -140,6 +140,8 @@ class StreamingAsyncBenchmarkClient(BenchmarkClient):
await call.write(self._request)
await call.read()
self._record_query_time(time.time() - start_time)
await call.done_writing()
assert grpc.StatusCode.OK == await call.code()
async def run(self):
await super().run()

Loading…
Cancel
Save