Page MenuHomePhabricator

[avalanche] Move scheduled dangling proof cleanup to init
Needs RevisionPublic

Authored by sdulfari on Sep 12 2022, 22:50.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

Primarily relevant to the unit tests: When a Processor is destroyed, the scheduler does not unschedule
the dangling proof cleanup. While most unit tests do not run long enough for this to be relevant, it's
clearly wrong that a scheduler can accumulate lambdas that capture destroyed objects.

This patch moves the dangling proof cleanup scheduling to init. The unit tests may call
cleanupDanglingProofs() directly if needed.

Test Plan
ninja check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Branch
init-dangling-proof-cleanup
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20004
Build 39697: Build Difflint-circular-dependencies · build-diff · build-without-wallet · build-debug · build-clang-tidy · build-clang
Build 39696: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Sep 13 2022, 07:34
Fabien added a subscriber: Fabien.

Since the problem can only occur on unit tests, why not fix it rather than working around it ? This is making the code awkward while all you need is to stop the scheduler before destructing the test fixture.

This revision now requires changes to proceed.Sep 13 2022, 07:34