Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Don't manually poll the ioservice after stopping capabilities #5533

Merged
merged 2 commits into from
Mar 27, 2019

Conversation

halfalicious
Copy link
Contributor

@halfalicious halfalicious commented Mar 27, 2019

Manually polling the ioservice on shutdown is redundant. The motivation behind doing this was to ensure that the posted capability timer cancellations (see Host::stopCapabilities) were processed during host shutdown (see #5523 for details). However, it turns out that there's no need to do this because the capability timers only need to be cancelled if more capability work loops are being scheduled, but more capability work loops are only scheduled during shutdown if we are disconnecting pending handshakes and/or peers, each of which result in the io service being polled anyway.

Manually polling the ioservice on shutdown is redundant. The motivation behind doing this was to ensure that the posted capability timer cancellations (see Host::stopCapabilities) were processed during host shutdown. However, it turns out that there's no need to do this because the capability timers only need to be cancelled if more capability work loops are being scheduled, but more capability work loops are only scheduled during shutdown if we are disconnecting pending handshakes and/or peers, each of which result in the io service being polled anyway.
@halfalicious halfalicious requested review from chfast and gumb0 and removed request for chfast March 27, 2019 03:21
@codecov-io
Copy link

Codecov Report

Merging #5533 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5533      +/-   ##
==========================================
- Coverage   61.87%   61.87%   -0.01%     
==========================================
  Files         344      344              
  Lines       28756    28752       -4     
  Branches     3267     3264       -3     
==========================================
- Hits        17792    17789       -3     
- Misses       9796     9797       +1     
+ Partials     1168     1166       -2

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Reference removal of ioservice polling and a message for the changes which fixed the capability timer race condition (#5523)
@chfast chfast force-pushed the capability-ioservice-polling branch from fd08e62 to 3c0c355 Compare March 27, 2019 10:04
@chfast chfast merged commit 98a1243 into master Mar 27, 2019
@chfast chfast deleted the capability-ioservice-polling branch March 27, 2019 11:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants