Skip to content

fix: log broadcast URI hostname resolution errors at ERROR level (#716)#882

Open
janisag07 wants to merge 2 commits intopermitio:masterfrom
janisag07:fix/issue-716-broadcast-error-logging
Open

fix: log broadcast URI hostname resolution errors at ERROR level (#716)#882
janisag07 wants to merge 2 commits intopermitio:masterfrom
janisag07:fix/issue-716-broadcast-error-logging

Conversation

@janisag07
Copy link
Copy Markdown

Problem

When the OPAL server is configured with a broadcast backend URI containing an unresolvable hostname, the error is silently swallowed. The server starts without any indication that broadcasting will fail, making it very difficult to debug connectivity issues.

Fix

  • URI validation on startup (pubsub.py): Added _validate_broadcast_uri() that checks the hostname can be resolved via socket.getaddrinfo(). Logs a clear ERROR message with the hostname and resolution failure. Passwords in URIs are masked in log output.
  • Disconnect error callback (server.py): Added a broadcaster disconnect callback that logs at ERROR level when the connection to the broadcast backend is lost.

Changes

  • packages/opal-server/opal_server/pubsub.py: URI validation + password masking
  • packages/opal-server/opal_server/server.py: Disconnect callback with error logging
  • 7 new tests covering validation, masking, and error paths

Notes

Behavior-compatible: validation is advisory (logs errors but does not prevent startup), so existing deployments are unaffected.

/claim #716

j.a. added 2 commits February 16, 2026 04:01
…lure (permitio#634)

When clone_repository or remote.fetch fails (e.g. GitHub is unreachable),
the partially created repo directory and any broken symlinks are now
properly cleaned up via _cleanup_repo_path(). The class-level repos cache
is also invalidated to prevent subsequent operations from using a broken
Repository object.

Changes:
- Add _cleanup_repo_path() helper for safe directory/symlink removal
- Add _invalidate_repo_cache() to evict broken repos from class caches
- _clone(): clean up repo_path and cache on pygit2.GitError
- fetch_and_notify_on_changes(): catch fetch GitError, clean up, return
- Invalid repo discovery path now also invalidates cache before cleanup
- Add comprehensive tests for all cleanup and cache invalidation paths

Closes permitio#634
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 16, 2026

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit 775c783
🔍 Latest deploy log https://app.netlify.com/projects/opal-docs/deploys/6992ce5591c85000082e5542

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.

1 participant