Skip to content

fix: clean up channels when gateway startup fails - #340

Open
Kunyanli230 wants to merge 1 commit into
bubbuild:mainfrom
Kunyanli230:fix/channel-startup-cleanup
Open

Kunyanli230 wants to merge 1 commit into
bubbuild:mainfrom
Kunyanli230:fix/channel-startup-cleanup

Conversation

@Kunyanli230

Copy link
Copy Markdown

If a channel fails during gateway startup, ChannelManager.listen_and_run() exits before reaching its cleanup block. Channels that started earlier keep running, and the framework retains its channel router.

Keep startup inside the cleanup scope and stop only channels that started successfully. Startup errors and cancellation still propagate. The regression test also checks router detachment and avoids stopping a channel that was never started.

Validation on Python 3.12:

  • make check passed (lockfile, pre-commit hooks, and mypy).
  • make test: 571 passed, 20 skipped.

The Python 3.13/3.14 matrix is left to CI, as permitted by the contribution guide. No CLI or documentation changes.

This branch has not been deployed

No deployments
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