fix: elevate broadcast hostname resolution errors from DEBUG to ERROR#884
Open
285729101 wants to merge 1 commit intopermitio:masterfrom
Open
fix: elevate broadcast hostname resolution errors from DEBUG to ERROR#884285729101 wants to merge 1 commit intopermitio:masterfrom
285729101 wants to merge 1 commit intopermitio:masterfrom
Conversation
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>
✅ Deploy Preview for opal-docs canceled.
|
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the silent swallowing of DNS resolution errors for the broadcast URI. The
gaierrorwhen resolving the broadcast hostname was previously logged at DEBUG level, making it extremely difficult for operators to diagnose misconfigured broadcast URIs.Closes #716
Changes
_validate_broadcast_uri()inPubSub.__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 theirOPAL_BROADCAST_URIconfigurationOpalServerwith_on_broadcaster_disconnected()that inspects the task exception (e.g.gaierror) and logs it at ERROR level instead of silently swallowing itNotes
pubsub.pyandserver.pyare modified/claim #716