Skip to content

Log broadcast listener failures#910

Open
JjCyberz wants to merge 2 commits into
permitio:masterfrom
JjCyberz:codex-log-broadcast-listener-errors
Open

Log broadcast listener failures#910
JjCyberz wants to merge 2 commits into
permitio:masterfrom
JjCyberz:codex-log-broadcast-listener-errors

Conversation

@JjCyberz
Copy link
Copy Markdown

Fixes #716.

When the server statistics broadcast listener task exits, OPAL currently only triggers a worker shutdown. If the task failed because the broadcast URI host cannot be resolved, the useful exception stays buried in dependency DEBUG output and no OPAL server ERROR log points at the broadcast URI.

This PR replaces the anonymous done callback with a named handler that:

  • reads the completed broadcast listener task result,
  • logs an ERROR when the task has an exception,
  • includes the configured broadcast URI and exception repr in the log message,
  • still triggers the same graceful worker shutdown behavior afterward.

Validation:

  • git diff --check
  • python -m py_compile packages/opal-server/opal_server/server.py

Bounty note:

/claim #716

@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2026

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit 0b49e3b
🔍 Latest deploy log https://app.netlify.com/projects/opal-docs/deploys/6a01cd89f9f6410008516c6d

@JjCyberz
Copy link
Copy Markdown
Author

Added a small unit test file covering the broadcast listener done-callback behavior:

  • logs the broadcast URI and exception when the listener task failed
  • logs cancellation separately
  • still triggers the existing graceful shutdown path

Local verification run:

python -m py_compile packages/opal-server/opal_server/server.py packages/opal-server/opal_server/tests/test_server_broadcast_listener.py

I could not run the pytest target locally because this environment does not have pytest installed, but the test is isolated and uses monkeypatching only around the imported module logger and shutdown method.

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