HomePhabricator

[avalanche] Fix a reversed lock order in ReattemptInitialBroadcast

Description

[avalanche] Fix a reversed lock order in ReattemptInitialBroadcast

Summary:
The expected lock order is cs_vNodes => cs_peerManager. Unfortunately the ReattemptInitialBroadcast method locks the opposite way, and causes a potential deadlock that has been uncovered by the getavaaddr functional test that mocks the scheduler time (for the statistics to be updated) and increase the chance of the reverse lock condition to occur.

Ref T1696.

Test Plan:

ninja all check-all

With debug:

for i in {1..1000}; do ./test/functional/test_runner.py abc_p2p_getavaaddr || break; done

Reviewers: #bitcoin_abc, tyler-smith

Reviewed By: #bitcoin_abc, tyler-smith

Subscribers: Mengerian, tyler-smith

Maniphest Tasks: T1696

Differential Revision: https://reviews.bitcoinabc.org/D11021

Details

Provenance
FabienAuthored on Feb 8 2022, 17:12
FabienPushed on Feb 9 2022, 08:12
Reviewer
Restricted Project
Differential Revision
D11021: [avalanche] Fix a reversed lock order in ReattemptInitialBroadcast
Parents
rABC54753fdd993d: [Cashtab] Mock getPubKey for unit tests
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task