Skip to content

fix(utils): log fire-and-forget background task failures - #283

Open
kiwipaulrob wants to merge 2 commits into
Sendspin:mainfrom
kiwipaulrob:fix/log-background-task-errors
Open

kiwipaulrob wants to merge 2 commits into
Sendspin:mainfrom
kiwipaulrob:fix/log-background-task-errors

Conversation

@kiwipaulrob

Copy link
Copy Markdown
Contributor

Problem

create_task() in sendspin/utils.py registers a done-callback that retrieves the exception (suppressing "never retrieved" warnings) and then discards it with no logging. Every fire-and-forget failure in the daemon is invisible, including the external-volume path (hook/amixer/PulseAudio errors swallowed, volume never published).

Fix

Replaces the lambda with a _log_task_exception callback that logs the exception with the task name (exc_info preserved). Cancelled tasks stay silent, as before; behaviour is otherwise unchanged.

Verification

  • Full suite (pytest tests/, excluding serve + audio_devices): 123 passed
  • ruff check clean

Small, no behaviour change beyond visibility. Happy to lower it to debug level if error is too noisy.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant