Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fix some more error branches, assert sanity, and automatically test it all. #14703

Merged
merged 6 commits into from
Jul 10, 2018

Conversation

riastradh-brave
Copy link
Contributor

fix #14630

Substantive changes:

  • Eliminate an assertion that socket closure happens more promptly than it is guaranteed to.
  • Allow destruction functions to be idempotent, now that I've convinced myself that this is sensible because there are legitimately multiple paths into them (in asynchronous error events and in synchronous callbacks).

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

#14630

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

This should address the failure reported in:
#14675 (comment)

fix #14630

Auditors: @diracdeltas

Test Plan: see #14630
This, and TorControl.destroy(), are worth making idempotent because
errors may happen synchronously _or_ asynchronously, so there are two
levels at which a caller might want to clean up.  For example,
authentication failure is reported as a 515 error from tor, _and_ the
tor daemon will close the control connection leading to an
asynchronous error.
There is no way to know exactly when this might happen, alas:
readables and writables don't necessarily emit their close events
promptly.
Copy link
Member

@diracdeltas diracdeltas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked manual test plan (worked) and int tests passed

@diracdeltas diracdeltas merged commit a742002 into master Jul 10, 2018
diracdeltas added a commit that referenced this pull request Jul 10, 2018
…es-v2

Fix some more error branches, assert sanity, and automatically test it all.
diracdeltas added a commit that referenced this pull request Jul 10, 2018
…es-v2

Fix some more error branches, assert sanity, and automatically test it all.
@diracdeltas
Copy link
Member

master: a742002
0.24.x: 73ec80d
0.23.x: febd810

@bsclifton bsclifton deleted the riastradh-tor-controlerrorbranches-v2 branch July 27, 2018 16:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tor control socket error when network is disconnected
2 participants