Skip to content

Make lifecycle teardown failure-safe #51

Description

@codeforester

Parent: #50

Train position: 1 of 22
Phase: P0 — Trustworthy lifecycle

Problem

A failing history writer can mask the command result and skip context reset, temporary-directory cleanup, and logger shutdown.

Acceptance criteria

  • The current Context is reset and cleanup runs exactly once on success and every exception path.
  • History/finalizer failures are best-effort: they are observable but cannot mask the command outcome or skip teardown.
  • Cleanup-hook and handler failures are isolated without preventing remaining teardown.
  • Regression tests cover command failure, a failing history writer, cleanup hooks, temp removal, context reset, logger closure, and log_file=None history records.

Dependencies

  • None

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions