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

SHM subsystem: Rust #823

Merged
merged 118 commits into from
Apr 19, 2024

Conversation

yellowhatter
Copy link
Contributor

@yellowhatter yellowhatter commented Mar 13, 2024

Closes #685
Closes #827

Conflicts:
	commons/zenoh-codec/src/core/shm.rs
- use numeric ID instead of string ID for SHM buffer identification - this feature speeds up segment lookups and reduces wire overhead
- remove unnecessary fields from SharedMemoryManager
- fix clippy warnings
- added comments
- support ProtocolID exchange in establish
- convert buffer based on supported protocol ids
- WIP to brush-up the API, eliminate some API flaws
- SHM provider is now conceptually made thread-safe for better flexibility
array: ArrayInSHM<AuthSegmentID, AuthChallenge, usize>,
}

impl AuthSegment {
Copy link
Member

Choose a reason for hiding this comment

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

With the current SHM system there is some leaking due to the shm segment never be closed.
How this new system will clean up all AuthSegment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AuthSegment, as any other zenoh SHM component, uses posix_shm::array::ArrayInSHM for managing shared memory. Previous SHM system used posix segment mapping on the filesystem - this mechanism required to manually delete SHM-mapped files to free shared memory and was unacceptable because our process might crash with no way to delete mapped files. The new SHM system uses system handles that are automatically unlinked when last linked process terminates, avoiding memory leakage.

Copy link
Member

Choose a reason for hiding this comment

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

Great, that's neat! :)

zenoh/src/bytes.rs Outdated Show resolved Hide resolved
@yellowhatter
Copy link
Contributor Author

@Mallets I resolved discussions where I made fixes

@Mallets Mallets merged commit 3711d45 into eclipse-zenoh:protocol_changes Apr 19, 2024
10 checks passed
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.

SHM subsystem: Rust SHM Provider API
5 participants