Skip to content

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

Merged
OnFreund merged 2 commits into
Sendspin:mainfrom
kiwipaulrob:fix/log-background-task-errors
Oct 6, 2026
Merged

OnFreund merged 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.

@OnFreund
OnFreund merged commit 2139ed7 into Sendspin:main Oct 6, 2026
2 checks passed
@maximmaxim345 maximmaxim345 added the bugfix Fixes a bug label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants