Silence benign grpc.aio noise#1127
Conversation
Signed-off-by: Albert Callarisa <albert@diagrid.io>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1127 +/- ##
==========================================
- Coverage 86.63% 82.13% -4.50%
==========================================
Files 84 117 +33
Lines 4473 9612 +5139
==========================================
+ Hits 3875 7895 +4020
- Misses 598 1717 +1119 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR centralizes suppression of a known-benign grpc.aio poller BlockingIOError: [Errno 11] log line by moving the targeted asyncio-logger filter into a shared dapr.common.logging helper and installing it in the core async gRPC client, while keeping workflow behavior unchanged via reuse of the shared helper.
Changes:
- Add
GrpcAioPollerNoiseFilter+silence_grpc_aio_poller_noise()indapr/common/logging.pyand install it fromDaprGrpcClientAsync.__init__. - Replace the workflow extension’s duplicated filter implementation with an import of the shared helper.
- Move/adjust tests so filter behavior + idempotency live in
tests/common/test_logging.py, and add a core async-client installation test.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ext/workflow/durabletask/test_grpc_aio_log_filter.py | Updates workflow durabletask test to assert the shared filter is installed (behavior tests moved elsewhere). |
| tests/common/test_logging.py | New unit tests for filter behavior and idempotent installation in the shared helper. |
| tests/common/init.py | Adds package marker for the new tests/common test module. |
| tests/clients/test_dapr_grpc_client_async.py | Adds a test verifying the core async gRPC client installs the filter once. |
| dapr/ext/workflow/AGENTS.md | Updates workflow agent guidance to reference the shared helper and core async client behavior. |
| dapr/ext/workflow/_durabletask/aio/internal/shared.py | Removes duplicated filter code and calls the shared silence_grpc_aio_poller_noise(). |
| dapr/common/logging.py | Introduces the shared filter and idempotent installer on the asyncio logger. |
| dapr/aio/clients/grpc/client.py | Installs the shared filter during async client initialization prior to channel creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The async
DaprClientcan emit noisy ERROR logs fromgrpc.aio's poller under load (BlockingIOError: [Errno 11]inPollerCompletionQueue._handle_events, upstream grpc/grpc#42357). The error is harmless, the poller retries the read and nothing is lost, and the workflow extension already suppresses it via a targetedasyncio-logger filter, but only when an async workflow client is created (#1053/#1102).This PR moves that filter to a shared home in
dapr/common/logging.pyand installs it fromDaprGrpcClientAsyncas well, so core async client users get the suppression too. The previously duplicated copy in_durabletask/aio/internal/shared.pynow imports the shared helper. The filter drops only records whose exception is aBlockingIOErrorand whose message references the poller callback; everything else on theasynciologger passes through.dapr/common/logging.py; behavior tests moved totests/common/test_logging.pyDaprGrpcClientAsync.__init__installs the filter (idempotent) before channel creationAGENTS.mdnote updated