Skip to content

Roll back failed bootstrap and fix Sentry route naming and Swagger typing - #406

Merged
lesnik512 merged 4 commits into
mainfrom
fix/382-bootstrap-rollback
Nov 2, 2026
Merged

lesnik512 merged 4 commits into
mainfrom
fix/382-bootstrap-rollback

Conversation

@lesnik512

@lesnik512 lesnik512 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

When instrument startup or application preparation raises, including KeyboardInterrupt or SystemExit, roll back only successfully started instruments in reverse order. Preserve the original failure with ordinary cleanup errors attached as notes, leave the bootstrapper unbootstrapped, and reject reuse after failure. Document the terminal failure contract.

Fix FastMCP lean Sentry transaction naming by assigning names in one place: preserve existing names, otherwise resolve full matched route templates through Mount and Host containers. Stop at the first full match, including opaque routes, and use scope route metadata only when no route tree was supplied. This covers newer Starlette versions that populate scope["route"] themselves.

Also specialize the Swagger instrument config in its typing test.

Closes #382.

Validation

  • Refreshed dependencies with just install, matching CI's upgrade recipe.
  • just test-ci: 604 passed, 100% coverage.
  • just lint-ci: passed, including repository-wide ty.
  • Failing regressions verified before fixes for interrupted startup, mounted FastAPI routes, Host routing, and opaque route selection.
  • Standards and spec reviews: no findings; both reviewers independently ran 86 focused tests.

@lesnik512
lesnik512 merged commit 880f09b into main Nov 2, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/382-bootstrap-rollback branch November 2, 2026 17:49
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.

Leave no half-bootstrapped state when an instrument's bootstrap() raises

1 participant