Replace silent BaseException swallowing in Docker teardown with structured warning capture #156

Closed
opened 2026-06-02 22:30:42 -04:00 by didericis-claude · 0 comments
Collaborator

Tracked from the medium-priority refactoring playbook in #154.

Docker teardown catches BaseException and discards it silently, which can hide cleanup failures and resource leaks. This makes it difficult to diagnose leftover containers or volumes after a failed run.

Work

  • Replace the bare except BaseException: pass (or equivalent) in the Docker teardown path with structured warning capture — log the exception at WARNING level with enough context (container ID, operation) to diagnose the failure.
  • Ensure the teardown still proceeds past the failed step rather than re-raising, so a single cleanup error does not block the rest of the teardown sequence.
  • Add a test that simulates a teardown failure and asserts the warning is emitted.
Tracked from the medium-priority refactoring playbook in #154. Docker teardown catches `BaseException` and discards it silently, which can hide cleanup failures and resource leaks. This makes it difficult to diagnose leftover containers or volumes after a failed run. ## Work - Replace the bare `except BaseException: pass` (or equivalent) in the Docker teardown path with structured warning capture — log the exception at WARNING level with enough context (container ID, operation) to diagnose the failure. - Ensure the teardown still proceeds past the failed step rather than re-raising, so a single cleanup error does not block the rest of the teardown sequence. - Add a test that simulates a teardown failure and asserts the warning is emitted.
didericis added the Kind/Enhancement label 2026-06-02 23:34:12 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#156