Skip to content

docs(planning): file the double-bootstrap guard change - #165

Merged
lesnik512 merged 1 commit into
mainfrom
docs/double-bootstrap-guard
Aug 10, 2026
Merged

docs(planning): file the double-bootstrap guard change#165
lesnik512 merged 1 commit into
mainfrom
docs/double-bootstrap-guard

Conversation

@lesnik512

Copy link
Copy Markdown
Member

One proposal, no code. Found while reviewing #164.

_attach_teardown_once guards teardown attachment and nothing else, so a second bootstrapper constructed on the same application still applies every instrument when bootstrap() is called. Both halves reproduced on current main:

  • Litestar raises from inside the framework — ImproperlyConfiguredException: Handler already registered for path '/health' and http method OPTIONS — which points nowhere near the real mistake.
  • FastAPI does not fail at all: the second bootstrap() returns the same app with its route count grown from 6 to 8, a shadowed duplicate of the health and metrics routes plus a second set of instrument state whose teardown is wired to nothing.

planning/changes/2026-08-10.04-double-bootstrap-guard.md proposes making bootstrap() raise ConfigurationError on the bootstrapper whose attach was skipped. The construction-time warning stays, so the documented warn-and-skip invariant for the teardown seam is unchanged.

just check-planning and just lint-ci pass.

🤖 Generated with Claude Code

A second bootstrapper on the same application skips only the teardown attach:
Litestar then dies with a duplicate-route error from inside the framework and
FastAPI silently registers a second copy of its health and metrics routes.
Both reproduced; the design makes bootstrap() raise instead.
@lesnik512
lesnik512 merged commit e062f66 into main Aug 10, 2026
11 checks passed
@lesnik512
lesnik512 deleted the docs/double-bootstrap-guard branch August 10, 2026 17:43
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