Page MenuHomePhabricator

[avalanche] Factorize the inflight request timeout handling
ClosedPublic

Authored by Fabien on Oct 22 2021, 08:57.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC9ed9d3e7a5d5: [avalanche] Factorize the inflight request timeout handling
Summary

This diff extracts a lambda that can be used with any kind of vote items, for now blocks and proofs.

Ref T1854.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_factorize_clear_inflight_request
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17117
Build 34066: Build Difflint-circular-dependencies · build-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang
Build 34065: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Oct 22 2021, 08:58
deadalnix requested changes to this revision.Oct 26 2021, 21:12
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/avalanche/processor.cpp
639 ↗(On Diff #30647)

This is taking the lock every time, even when not needed.

This is a regression vs the existing code.

This revision now requires changes to proceed.Oct 26 2021, 21:12
src/avalanche/processor.cpp
636 ↗(On Diff #30647)

You can use the WITH_LOCK construct now.

Use a more readable WITH_LOCK construct and avoid the lock when not needed by passing the rwcollection instread of the write view to the lambda

This revision is now accepted and ready to land.Oct 27 2021, 14:14