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

[#532] resizable shm support in publisher #540

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Dec 3, 2024

Notes for Reviewer

Integrates the resizable shared memory into the publisher and subscriber.

  • created a new class DataSegment that abstracts the resizable and non-resizable shared memory handling
    • the DataSegment class is used by the Subscriber and Publisher and will be later used also by the Server and Client
  • renamed max_slice_len into initial_max_slice_len to make it clear that this is not an absolut limit but it is the initial estimation
  • Adjusted the C++/Rust dynamic memory example so that it reallocates
  • The sample layouts are tracked in the publisher since we require it to calculate the tracker index, the index under which the sample is tracked (sample tracker and the local ref count)
  • Added PoolAllocator::deallocate_bucket() that does not require a layout since all buckets have the same layout - allows us to not track the individual layout of a sample only the segment id
  • The sample size must be provided in send for the zero copy connection to be able to calculate the tracker index inside the connection. Currently, the zero-copy connection has an indirect hard dependency to a pool allocator.

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Closes #532

@elBoberido elBoberido marked this pull request as draft December 3, 2024 22:41
@elfenpiff elfenpiff changed the title WIP [#532] resizable shm support in publisher [#532] resizable shm support in publisher Dec 4, 2024
@elfenpiff elfenpiff marked this pull request as ready for review December 4, 2024 12:07
@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch 3 times, most recently from ce5a374 to a2184c1 Compare December 4, 2024 14:33
@elfenpiff elfenpiff requested review from elBoberido and orecham and removed request for elBoberido December 4, 2024 14:37
@elfenpiff elfenpiff self-assigned this Dec 4, 2024
…trategy of the publisher; rename max_slice_len into initial_max_slice_len
…ervice segment; add data segment type to the publisher port details
@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch from ff1deaa to ec0bc59 Compare December 4, 2024 14:54
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 91.43469% with 40 lines in your changes missing coverage. Please review.

Project coverage is 79.18%. Comparing base (b1d41bb) to head (f08c0a0).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2/src/port/details/data_segment.rs 86.15% 18 Missing ⚠️
...ceoryx2-cal/src/resizable_shared_memory/dynamic.rs 88.46% 6 Missing ⚠️
iceoryx2/src/port/publisher.rs 96.40% 5 Missing ⚠️
iceoryx2/src/port/subscriber.rs 55.55% 4 Missing ⚠️
iceoryx2/src/sample_mut.rs 50.00% 4 Missing ⚠️
iceoryx2-cal/src/zero_copy_connection/common.rs 95.23% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #540      +/-   ##
==========================================
+ Coverage   79.13%   79.18%   +0.04%     
==========================================
  Files         202      203       +1     
  Lines       24887    25123     +236     
==========================================
+ Hits        19695    19894     +199     
- Misses       5192     5229      +37     
Files with missing lines Coverage Δ
iceoryx2-bb/memory/src/pool_allocator.rs 94.87% <100.00%> (+0.06%) ⬆️
iceoryx2-cal/src/shared_memory/common.rs 87.03% <100.00%> (+0.49%) ⬆️
iceoryx2-cal/src/shared_memory/mod.rs 100.00% <ø> (ø)
iceoryx2-cal/src/shm_allocator/pool_allocator.rs 96.94% <100.00%> (+0.04%) ⬆️
iceoryx2-cal/src/zero_copy_connection/mod.rs 12.50% <ø> (ø)
iceoryx2/src/port/details/publisher_connections.rs 100.00% <100.00%> (ø)
...ceoryx2/src/port/details/subscriber_connections.rs 94.80% <100.00%> (ø)
iceoryx2/src/sample.rs 73.17% <100.00%> (+5.52%) ⬆️
iceoryx2/src/sample_mut_uninit.rs 80.00% <100.00%> (+1.12%) ⬆️
iceoryx2/src/service/config_scheme.rs 97.75% <100.00%> (+0.22%) ⬆️
... and 13 more

... and 7 files with indirect coverage changes

@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch 2 times, most recently from 5f8df9e to d6da7fc Compare December 4, 2024 19:26
Cargo.toml Outdated Show resolved Hide resolved
examples/cxx/publish_subscribe_dynamic_data/README.md Outdated Show resolved Hide resolved
iceoryx2/src/port/publisher.rs Show resolved Hide resolved
@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch 3 times, most recently from 356a507 to d6da7fc Compare December 5, 2024 13:29
@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch from d6da7fc to b150b78 Compare December 5, 2024 14:48
@elfenpiff elfenpiff requested a review from elBoberido December 5, 2024 15:19
elBoberido
elBoberido previously approved these changes Dec 5, 2024
@elfenpiff elfenpiff force-pushed the iox2-532-resizable-shm-support-in-publisher branch from d514f1d to f08c0a0 Compare December 5, 2024 15:47
@elfenpiff elfenpiff merged commit ad49e19 into eclipse-iceoryx:main Dec 5, 2024
47 checks passed
@elfenpiff elfenpiff deleted the iox2-532-resizable-shm-support-in-publisher branch December 5, 2024 16:44
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.

ResizableSharedMemory support for publisher
2 participants