Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Fixed
- `RST_STREAM with error code 0` (HTTP/2 `NO_ERROR`, a normal server-side graceful reset) is now logged at `DEBUG` instead of `WARNING` to reduce log noise
- `CANCELLED` (server closed the stream normally, e.g. keepalive timeout or server rotation) is now logged at `INFO` instead of `WARNING`
- `UNAUTHENTICATED` reconnects handled by the automatic token refresh are now logged at `INFO` instead of `WARNING`

## [0.3.0] - 2026-05-12

### Added
Expand Down
23 changes: 20 additions & 3 deletions src/quilt_hp/services/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ async def _run_stream_with_reconnect(self) -> None:

if is_unauth and self._authenticate is not None and can_retry:
self._stream_state = "reconnecting"
logger.warning(
# Token expiry is handled automatically — INFO to confirm it
# happened without alarming the user.
logger.info(
"Stream got UNAUTHENTICATED; refreshing token (attempt %d)",
attempt + 1,
)
Expand All @@ -630,10 +632,25 @@ async def _run_stream_with_reconnect(self) -> None:
break
elif can_retry:
self._stream_state = "reconnecting"
logger.warning(
details = exc.details() or ""
# Classify the error to pick the right log level:
# DEBUG — HTTP/2 NO_ERROR RST_STREAM: server gracefully
# recycled the connection (load balancer, keepalive).
# INFO — CANCELLED: server closed the stream normally
# (keepalive timeout, server rotation, etc.).
# WARNING — anything else is unexpected.
is_graceful_reset = "RST_STREAM with error code 0" in details
is_server_cancel = exc.code() == grpc.StatusCode.CANCELLED
if is_graceful_reset:
log = logger.debug
elif is_server_cancel:
log = logger.info
else:
log = logger.warning
log(
"Stream error %s: %s; reconnecting in %.1fs (attempt %d)",
exc.code(),
exc.details(),
details,
delay,
attempt + 1,
)
Expand Down