Skip to content

kvs: changed approach to locking - #633

Open
arkjedrz wants to merge 1 commit into
eclipse-score:mainfrom
qorix-group:arkjedrz_mutex-lock
Open

arkjedrz wants to merge 1 commit into
eclipse-score:mainfrom
qorix-group:arkjedrz_mutex-lock

Conversation

@arkjedrz

Copy link
Copy Markdown
Contributor
  • "Wait for unlock" approach instead of "fail on busy".
  • Updated safety docs.
  • Removed unused C++ KMutexLockFailed error.
  • Removed obsolete tests.

Fixes #607

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Starting local Bazel server (8.7.0) and connecting to it...
INFO: Invocation ID: 9e9750af-5a0d-4048-b7fa-def731869daf
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 2 packages loaded
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)

Analyzing: target //:license-check (94 packages loaded, 14 targets configured)

Analyzing: target //:license-check (100 packages loaded, 14 targets configured)

Analyzing: target //:license-check (100 packages loaded, 14 targets configured)

Analyzing: target //:license-check (199 packages loaded, 5821 targets configured)

Analyzing: target //:license-check (207 packages loaded, 11661 targets configured)

Analyzing: target //:license-check (207 packages loaded, 11661 targets configured)

Analyzing: target //:license-check (208 packages loaded, 11785 targets configured)

Analyzing: target //:license-check (209 packages loaded, 15886 targets configured)

Analyzing: target //:license-check (212 packages loaded, 17774 targets configured)

INFO: Analyzed target //:license-check (213 packages loaded, 17903 targets configured).
[12 / 16] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 50 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/tools/formatted.txt
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //tools:license.check.license_check up-to-date:
  bazel-bin/tools/license.check.license_check
  bazel-bin/tools/license.check.license_check.jar
INFO: Elapsed time: 35.958s, Critical Path: 1.95s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/tools/license.check.license_check tools/formatted.txt <args omitted>
[main] INFO Querying Eclipse Foundation for license data for 42 items.
[main] INFO Found 32 items.
[main] INFO Querying ClearlyDefined for license data for 10 items.
[main] INFO Found 10 items.
[main] INFO License information could not be automatically verified for the following content:
[main] INFO 
[main] INFO crate/cratesio/-/lazy_static/1.5.1
[main] INFO 
[main] INFO This content is either not correctly mapped by the system, or requires review.

Comment thread score/kvs/kvs.cpp Fixed
Comment thread score/kvs/kvs.cpp Fixed
Comment thread score/kvs/kvs.cpp Fixed
Comment thread score/kvs/kvs.cpp Fixed
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-633: https://eclipse-score.github.io/persistency/pr-633/

@arkjedrz
arkjedrz marked this pull request as draft October 30, 2026 12:22
@arkjedrz
arkjedrz force-pushed the arkjedrz_mutex-lock branch from 3cfbdb0 to 13afb8f Compare October 30, 2026 13:01
@arkjedrz
arkjedrz marked this pull request as ready for review October 30, 2026 13:02
Comment thread score/kvs/kvs.cpp
}
default_values_ = std::move(other.default_values_);

filesystem_ = std::move(other.filesystem_);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i see crash could happen here using the following scenario

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if related to this change. Maybe it's a candidate for an AoU.
C++ is allowing use-after-move with std library objects being left in valid but unspecified state. We don't have to adhere to that, as MISRA C++:2023 Rule 28.6.3 says "An object shall not be used while in a potentially moved-from state." and it is forbidden by clang-tidy's "bugprone-use-after-move".

- "Wait for unlock" approach instead of "fail on busy".
- Updated safety docs.
- Removed unused C++ `KMutexLockFailed` error.
- Removed obsolete tests.
@arkjedrz
arkjedrz force-pushed the arkjedrz_mutex-lock branch from 13afb8f to c560616 Compare November 2, 2026 19:11

This branch is waiting to be deployed

1 waiting (outdated) deployment
workflow-approval — 13afb8ff Waiting Oct 30, 2026 by arkjedrz via qnx-build (score-qnx-x86_64) / approval #1656
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.

Approach to mutex locking is not clear

3 participants