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

[#458] corrupted services cleanup #587

Merged

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Jan 13, 2025

Notes for Reviewer

Shared Memory is not persistent in Windows. Whenever the last process that holds a shared memory handle terminates or crashes Windows removes the memory-mapped file from the file system. When a new process starts, it detects that there seems to exist the service but the dynamic segment of the service is missing - since the last process holding it crashed. So, it is correctly identified as corrupted, and the cleanup aborts here.

The solution is, when the node cleans up all stale resources and identifies a service as corrupted it deletes the static service config so that the service is removed completely.

In Windows we have to also handle the shm state file - which stores the shared memory size. So whenever a new shared memory is created and the state file already exists but the corresponding shared memory does not. The state file is removed and recreated again.

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Consider switching the PR to a draft (Convert to draft)
    • as draft PR, the CI will be skipped for pushes
  • Relevant issues are linked in the References section
  • Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  • Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  • Commits messages are according to this guideline
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes
  • Assign PR to reviewer
  • 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

  • All open points are addressed and tracked via issues

References

Relates to #458

@elfenpiff elfenpiff requested a review from elBoberido January 13, 2025 15:13
@elfenpiff elfenpiff self-assigned this Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 38.23529% with 42 lines in your changes missing coverage. Please review.

Project coverage is 79.10%. Comparing base (df775df) to head (f912afc).
Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2/src/node/mod.rs 14.28% 36 Missing ⚠️
iceoryx2/src/service/mod.rs 75.00% 4 Missing ⚠️
iceoryx2/src/service/naming_scheme.rs 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #587      +/-   ##
==========================================
- Coverage   79.32%   79.10%   -0.22%     
==========================================
  Files         203      203              
  Lines       25302    25362      +60     
==========================================
- Hits        20070    20063       -7     
- Misses       5232     5299      +67     
Files with missing lines Coverage Δ
iceoryx2/src/service/builder/event.rs 76.22% <100.00%> (-1.52%) ⬇️
iceoryx2/src/service/builder/publish_subscribe.rs 88.38% <100.00%> (-2.59%) ⬇️
iceoryx2/src/service/naming_scheme.rs 94.87% <66.66%> (-5.13%) ⬇️
iceoryx2/src/service/mod.rs 73.60% <75.00%> (-0.44%) ⬇️
iceoryx2/src/node/mod.rs 64.25% <14.28%> (-3.59%) ⬇️

... and 35 files with indirect coverage changes

elBoberido
elBoberido previously approved these changes Jan 13, 2025
iceoryx2/src/node/mod.rs Outdated Show resolved Hide resolved
@elfenpiff elfenpiff requested a review from elBoberido January 13, 2025 16:07
@elfenpiff elfenpiff merged commit 2eb752b into eclipse-iceoryx:main Jan 13, 2025
48 of 49 checks passed
@elfenpiff elfenpiff deleted the iox2-458-corrupted-services-cleanup branch January 13, 2025 16:50
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.

2 participants