Page MenuHomePhabricator

[avalanche] Sanitize the thread safety checks in the processor
ClosedPublic

Authored by Fabien on Jan 23 2024, 15:26.

Details

Summary

This diff adds a cs_main runtime check to the proof isWorthPolling variant. The addToReconcile (and in turn the isWorthPolling visitor that it calls) is critical to get thread safe and avoid lock ordering issues as it is called from various threads (sceduler, net, ...).
Unfortunately clang thread safety annotation does not play well with std::variants as it assumes all the variants are reachable, making it complicated and inefficient to maintain the annotations.
As a consequence this diff also removes some annotations from addToReconcile and co. which are arleady present at the variant level and caught by the debug builds or tsan.

Test Plan

With Clang and Debug:

ninja all check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_cs_main_add_to_reconcile
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26580
Build 52730: Build Difflint-circular-dependencies · build-without-wallet · build-debug · build-clang · build-diff · build-clang-tidy
Build 52729: arc lint + arc unit