Skip to content

fix: Channel's recursive_close issue#26

Open
IthacaDream wants to merge 1 commit intoGhostInShells:mainfrom
IthacaDream:fix/recursive_close
Open

fix: Channel's recursive_close issue#26
IthacaDream wants to merge 1 commit intoGhostInShells:mainfrom
IthacaDream:fix/recursive_close

Conversation

@IthacaDream
Copy link
Contributor

Fixes: #25

Summary

  • Fix recursive_close in Channel.run_in_ctx to always traverse all children and then close the current channel if running.
  • This ensures a consistent, bottom-up shutdown across the entire channel tree.

What changed

  • Removed the early return when a node has no children.
  • Removed the if not child.is_running() guard; always recurse into every child.

Verification

  • run pytest tests/channels/test_thread_channel.py::test_channel_run_in_ctx_closes_child_channels

return
group_stop = []
for child in children.values():
if not child.is_running():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if-condition is inverted

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.

[bug] PyChannel's recursive_close returns early and skips running children, leaving parts of the channel tree unclosed

1 participant

Comments