Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close builder #1576

Merged
merged 20 commits into from
Dec 3, 2024
Merged

Close builder #1576

merged 20 commits into from
Dec 3, 2024

Conversation

yellowhatter
Copy link
Contributor

@yellowhatter yellowhatter commented Oct 31, 2024

  1. Close builder added with implementations for Session and Runtime
  2. Remove ephemeral ports in tests

Copy link

PR missing one of the required labels: {'bug', 'documentation', 'dependencies', 'new feature', 'enhancement', 'internal', 'breaking-change'}

@yellowhatter yellowhatter added enhancement Existing things could work better api fix Correct API labels Oct 31, 2024
@yellowhatter yellowhatter changed the title atexit-safe close builder draft Close builder Nov 5, 2024
@yellowhatter yellowhatter marked this pull request as ready for review November 5, 2024 10:49
fix ephemeral ports in tests
- remove backoff from CloseBuilder
- simplify some code around CloseBuilder
Conflicts:
	zenoh/src/api/session.rs
@yellowhatter
Copy link
Contributor Author

Ci failed because of this: #1586

for TaskController::terminate_all_async change, repo search shows that there is no other projects using it through "internal" feature

@yellowhatter yellowhatter added the release Part of the next release label Nov 8, 2024
@yellowhatter yellowhatter requested a review from Mallets November 11, 2024 08:55
@YuanYuYuan
Copy link
Contributor

Hi @yellowhatter , here are my comments.

  • These functions have no timeout, unlike their previous versions:
    • TransportManager::close
    • TerminatableTask::terminate
  • Consider splitting the ephemeral port removal into a separate PR.
  • Introducing two additional traits to create a concrete SessionCloseBuilder might be over engineering.
    Instead, let's focus on configuring the close behavior through a well-structured SessionCloseBuilder::new(config), just like we do in the other builders.
    This could include setting options like switching between a timeout-based blocking mode and a non-blocking mode.

@yellowhatter
Copy link
Contributor Author

yellowhatter commented Nov 13, 2024

Hi, @YuanYuYuan

  • These functions have no timeout, unlike their previous versions:

    • TransportManager::close
    • TerminatableTask::terminate

This is intentional. They used internal future timeout, and now I rely on top-level future timeout that can be modified by the user.

@Mallets
Copy link
Member

Mallets commented Nov 13, 2024

Without entering the internal details of this particular PR, I think this kind of API addition should be coordinated with @milyin for all the bindings (C, C++, Python, etc.). Adding a timeout in the close builder/option is something we may want to expose as well in all other languages.

@yellowhatter
Copy link
Contributor Author

Without entering the internal details of this particular PR, I think this kind of API addition should be coordinated with @milyin for all the bindings (C, C++, Python, etc.). Adding a timeout in the close builder/option is something we may want to expose as well in all other languages.

Sure. This change doesn't break the current bindings, and we will coordinate on it's support everywhere after this one get merged

@YuanYuYuan
Copy link
Contributor

Yes. We could first discuss the use cases to see what options we want to expose. For instance, making the zenoh session terminate itself in a manner of nonblocking way if it has already been exit stage.

@yellowhatter
Copy link
Contributor Author

for this: ZettaScaleLabs/rmw_zenoh#35

Copy link
Contributor

@milyin milyin left a comment

Choose a reason for hiding this comment

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

Looks good, but test for new functionality is needed

zenoh/src/api/builders/close.rs Outdated Show resolved Hide resolved
@yellowhatter
Copy link
Contributor Author

three_node_combination_multicast test is failing on windows, as I can see this is a known flaky one

@yellowhatter yellowhatter requested review from milyin and removed request for YuanYuYuan December 3, 2024 14:19
@yellowhatter
Copy link
Contributor Author

Looks good, but test for new functionality is needed

added tests

@milyin milyin merged commit c6f52c2 into eclipse-zenoh:main Dec 3, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api fix Correct API enhancement Existing things could work better release Part of the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants