diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi index a630ed88117..8c74d3ee22b 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi @@ -884,6 +884,8 @@ cdef class AioServer: def _serving_task_crash_handler(self, object task): """Shutdown the server immediately if unexpectedly exited.""" + if task.cancelled(): + return if task.exception() is None: return if self._status != AIO_SERVER_STATUS_STOPPING: