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

Migrate SHM #1798

Merged
merged 55 commits into from
Mar 6, 2025
Merged

Migrate SHM #1798

merged 55 commits into from
Mar 6, 2025

Conversation

yellowhatter
Copy link
Contributor

@yellowhatter yellowhatter commented Feb 26, 2025

  • migrate from shared-memory crate to own SHM api wrapper
  • suppress SHM persistency on Windows and BSD
  • optimize some SHM object sizes
  • get rid of separate SegmentLock struct - use advisory locking within Segment
  • improve SHM error handling
  • query real SHM segment size upon creation and opening (the sizes will differ depending on system page size)
  • expose real segment size in all our segment abstractions (Segment and ArrayInShm)
  • utilize real segment sizes in PosixShmProviderBackend to expose more occupied memory to user

@yellowhatter yellowhatter self-assigned this Feb 26, 2025
Copy link

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

@yellowhatter yellowhatter added enhancement Existing things could work better dependencies Pull requests that update a dependency file release Part of the next release internal Changes not included in the changelog labels Feb 26, 2025
@yellowhatter yellowhatter marked this pull request as ready for review February 27, 2025 18:31
@yellowhatter
Copy link
Contributor Author

lints: base64ct issue
macos: flacky test

Copy link
Contributor

@YuanYuYuan YuanYuYuan left a comment

Choose a reason for hiding this comment

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

Hi @yellowhatter, besides the comments, I have one more question.

We added advisory-lock as a new dependency, but it has been inactive for five years. Should we be concerned about this?

@@ -0,0 +1,99 @@
//
// Copyright (c) 2023 ZettaScale Technology
Copy link
Contributor

Choose a reason for hiding this comment

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

2023 -> 2025

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

#[test]
fn create_and_open_amd_reopen() {
Copy link
Contributor

Choose a reason for hiding this comment

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

amd -> and

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 89.39394% with 21 lines in your changes missing coverage. Please review.

Project coverage is 70.40%. Comparing base (cac67d9) to head (e5a856b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
commons/zenoh-shm/src/shm/unix.rs 89.16% 13 Missing ⚠️
commons/zenoh-shm/src/posix_shm/segment.rs 72.22% 5 Missing ⚠️
...mplementations/posix/posix_shm_provider_backend.rs 85.71% 1 Missing ⚠️
commons/zenoh-shm/src/posix_shm/array.rs 92.30% 1 Missing ⚠️
commons/zenoh-shm/src/shm/mod.rs 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1798      +/-   ##
==========================================
- Coverage   70.41%   70.40%   -0.02%     
==========================================
  Files         358      359       +1     
  Lines       64586    64617      +31     
==========================================
+ Hits        45476    45491      +15     
- Misses      19110    19126      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- fix segment collision from different runs
@yellowhatter yellowhatter requested a review from YuanYuYuan March 5, 2025 14:45
@yellowhatter
Copy link
Contributor Author

Hi @yellowhatter, besides the comments, I have one more question.

We added advisory-lock as a new dependency, but it has been inactive for five years. Should we be concerned about this?

  1. We are already using advisory-lock crate in our workspace (unixpipe link)
  2. This crate just wraps a very simple system AP (flock())

I think there is no problem to use it while it satisfies our needs

@YuanYuYuan YuanYuYuan merged commit e76243b into eclipse-zenoh:main Mar 6, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement Existing things could work better internal Changes not included in the changelog release Part of the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants