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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

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
- 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
@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.

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.

3 participants