Page MenuHomePhabricator

fix: tor: Call event_base_loopbreak from the event's callback
ClosedPublic

Authored by PiRK on Oct 12 2020, 06:49.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC3f706f09ac93: fix: tor: Call event_base_loopbreak from the event's callback
Summary

PR description:

Calling event_base_loopbreak before event_base_dispatch has no effect. Fix this by calling event_base_loopbreak from the event's callback. From the documentation:

event_base_loop() will abort the loop after the next event is completed; event_base_loopbreak() is typically invoked from this event's callback. This behavior is analogous to the "break;" statement.

The issue was:

When I run
./bitcoind -regtest -whitebind=bla
I expect a clean shutdown with Error: Cannot resolve -whitebind address: 'bla'.
However sometimes my node doesn't stop and freezes (shutdown never finishes).

Backport of Core PR16405

Test Plan

ninja all check-all

./src/bitcoind -regtest -proxy=127.0.0.1:9050 -listen=1 -bind=127.0.0.1 -whitebind=127.0.0.1:0

After this patch, bitcoind shuts down properly after Error: Cannot resolve -whitebind address: ...

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable