Skip to content

fix: elevate broadcast hostname resolution errors from DEBUG to ERROR#884

Open
285729101 wants to merge 1 commit intopermitio:masterfrom
285729101:fix/broadcast-hostname-error-logging
Open

fix: elevate broadcast hostname resolution errors from DEBUG to ERROR#884
285729101 wants to merge 1 commit intopermitio:masterfrom
285729101:fix/broadcast-hostname-error-logging

Conversation

@285729101
Copy link
Copy Markdown

Description

Fixes the silent swallowing of DNS resolution errors for the broadcast URI. The gaierror when resolving the broadcast hostname was previously logged at DEBUG level, making it extremely difficult for operators to diagnose misconfigured broadcast URIs.

Closes #716

Changes

  • Added _validate_broadcast_uri() in PubSub.__init__() that performs an early DNS resolution check at startup and logs at ERROR level if it fails, with a descriptive message pointing operators to check their OPAL_BROADCAST_URI configuration
  • Replaced the anonymous lambda broadcaster disconnect callback in OpalServer with _on_broadcaster_disconnected() that inspects the task exception (e.g. gaierror) and logs it at ERROR level instead of silently swallowing it

Notes

  • Both changes are advisory only -- they log errors but do not prevent startup or alter existing control flow, preserving full backward compatibility
  • Minimal change footprint: only pubsub.py and server.py are modified

/claim #716

When the OPAL server is configured with a broadcast URI containing an
unresolvable hostname, the gaierror exception was silently swallowed and
only logged at DEBUG level by the underlying fastapi_websocket_pubsub
library. This made it extremely difficult for operators to diagnose
misconfigured broadcast URIs.

Changes:
- Add _validate_broadcast_uri() in PubSub that performs an early DNS
  resolution check at startup and logs at ERROR level if it fails
- Replace the anonymous lambda broadcaster disconnect callback with
  _on_broadcaster_disconnected() that inspects the task exception and
  logs it at ERROR level (catches the gaierror at runtime too)

Both changes are advisory only -- they do not prevent startup or change
existing control flow, preserving backward compatibility.

Closes permitio#716

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 17, 2026

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit f49f8c5
🔍 Latest deploy log https://app.netlify.com/projects/opal-docs/deploys/6994385eea562b0008a68c2f

@285729101
Copy link
Copy Markdown
Author

@asafc @orweis elevates broadcast hostname resolution errors from DEBUG to ERROR so failed resolution is visible in logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error resolving broadcast hostname being swallowed

1 participant