[refine](exec/operator) replace std::mutex/std::lock_guard with annotated wrappers for thread safety analysis#63070
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
7f97364 to
a29fb60
Compare
|
/review |
|
OpenCode automated review failed and did not complete. Error: Review step was failure (possibly timeout or cancelled) Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
|
/review |
There was a problem hiding this comment.
Review opinion: no blocking issues found in the changed PR diff.
Critical checkpoint conclusions:
- Goal/test: The PR appears focused on adding annotated mutex/lock wrappers and applying them to selected pipeline shared-state locks so Clang thread-safety annotations can be used. The existing multicast streamer test was adjusted to respect the new guarded fields; I did not run tests in this review environment.
- Scope/focus: The change is small and focused on lock annotation/conversion in the authoritative PR patch.
- Concurrency: Reviewed the converted pipeline locks, dependency interactions, multicast spill/read paths, shared hash table finish dependency list, exchange finished-channel set, and scan conjunct lock. I did not find a concrete introduced race, missed wake-up, or deadlock from the changed lock wrappers/usages.
- Lifecycle/static initialization: No new static/global lifecycle dependency was introduced.
- Configuration/compatibility: No new config items, wire protocol changes, persisted format changes, or rolling-upgrade compatibility concerns were found.
- Parallel paths: The modified paths are localized conversions; no obvious parallel path requires the same annotation change for correctness.
- Conditional checks/error handling: No new unchecked Status or silent error continuation was found in the changed code.
- Test coverage/results: Existing test coverage is lightly adjusted for guarded access; no new behavioral test was required by the annotation-only intent. I did not verify by running BE tests.
- Observability: No new runtime behavior requiring additional logs or metrics was introduced.
- Transactions/data writes/FE-BE passing: Not applicable to this PR diff.
- Performance: The annotated wrappers preserve std::mutex semantics at reviewed call sites; no obvious hot-path extra work is introduced outside BE_TEST mock sleeps.
User focus: no additional user-provided review focus was present.
|
run buildall |
TPC-H: Total hot run time: 29606 ms |
TPC-DS: Total hot run time: 169778 ms |
|
run p0 |
|
run cloud_p0 |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
What problem does this PR solve?
What problem does this PR solve?
Issue Number: N/A
Problem Summary:
This PR introduces Clang thread safety annotations (-Wthread-safety) to pipeline operator shared states by
replacing raw std::mutex/std::lock_guard/std::unique_lock with annotated wrappers (AnnotatedMutex, LockGuard,
UniqueLock), and by decorating guarded member variables with GUARDED_BY attributes. This enables the compiler to
statically detect data races where a field is accessed without holding its associated mutex.
The change also fixes two bugs uncovered during the annotation process:
branch to fire on the prior call's stale state rather than the current one.
check is now done via a boolean captured inside the lock.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)