You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a1066d
Browse filesBrowse the repository at this point in the historyBrowse files
fix: refuse to bootstrap a second bootstrapper on one application (#167)
_attach_teardown_once guarded the teardown hook and nothing else, so the losing
bootstrapper still applied every instrument on bootstrap(). Litestar died with a
duplicate-route error from inside the framework; FastAPI did not fail at all and
silently registered a second copy of its health and metrics routes.
bootstrap() now raises ConfigurationError naming the bootstrapper class.
Construction still only warns, so the teardown seam's warn-and-skip invariant is
unchanged. Covered for all four app-bearing frameworks, with a FreeBootstrapper
test pinning that the guard does not fire where there is no attach target.
The ownership marker is never cleared, including by teardown(), so a
bootstrapped application stays owned for the life of the process; the remedy is
documented in architecture/bootstrappers.md and the release notes.
See planning/changes/2026-08-10.04-double-bootstrap-guard.md
Copy file name to clipboardExpand all lines: planning/changes/2026-08-10.04-double-bootstrap-guard.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
summary: Make a second bootstrapper on an already-bootstrapped application fail loudly — `bootstrap()` raises `ConfigurationError` instead of dying inside Litestar with a duplicate-route error or silently double-registering FastAPI's routes.
2
+
summary: A second bootstrapper on the same application now fails loudly — `bootstrap()` raises `ConfigurationError` on the bootstrapper whose teardown attach was skipped, instead of dying inside Litestar with a duplicate-route error or silently double-registering FastAPI's routes. The construction-time warning is unchanged in kind, reworded to say the second bootstrapper's `bootstrap()` will raise. `FreeBootstrapper` has no attach target and is unaffected.
3
3
---
4
4
5
5
# Design: Fail fast when a second bootstrapper targets the same application
0 commit comments