Skip to content

Silent exception swallowing in mcp/server.py:485-499 (spool drain + retention scheduler) #29

@emp3thy

Description

@emp3thy

Problem

mcp/server.py:485-499 wraps spool.drain() and the retention scheduler call in broad excepts that swallow exceptions silently with no logging. If either silently fails for weeks, no one will know — the retention scheduler in particular is invisible (it runs in the background of the next retrieve call).

Suggested fix

Route these exceptions into the hook_errors table the way hooks/_error_log.py already does, or at minimum log via logging.exception on a named logger. The point is that a failure should produce a discoverable diagnostic, not vanish.

Acceptance criteria

  • Exceptions in the spool drain and retention scheduler paths are recorded somewhere queryable (DB row or log file)
  • A test covers the failure-recorded behaviour for at least one of the two paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions