Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Fix exception when an out-of-date descriptor is received #64

Merged
merged 2 commits into from
Apr 28, 2017

Conversation

DonnchaC
Copy link
Owner

This commit fixes a bug where None was returned from Instance.update_descriptor() rather than a boolean. If a received instance descriptor is older than the current descriptor it was discarded and None was returned.

Instead False should be returned as the boolean result it later compared in descriptor_received().

Resolves exception in #62.

This commit fixes a bug where `None` was returned from
`Instance.update_descriptor()` rather than a boolean. If a received
instance descriptor is older than the current descriptor it was
discarded and None was returned. Instead `False` should be returned as
the boolean result it later compared in `descriptor_received()`.
s
@coveralls
Copy link

coveralls commented Apr 28, 2017

Coverage Status

Coverage remained the same at 34.828% when pulling f87fdad on fix/62-old-descriptor-crash into 78b10a9 on develop.

The Stem Tor control port library starts an event notifier thread and
makes callbacks to the OnionBalance daemon with new events. If an
unhandled exception occurs in an event callback the event notifier
thread will crash. This will prevent OnionBalance getting new descriptor
updates and eventual the onion service will go offline.

This commit adds a `try: except` block around both event callback
functions which should gracefully handle unexpected errors in the
event notifier thread.
@DonnchaC DonnchaC merged commit 72657ac into develop Apr 28, 2017
@DonnchaC DonnchaC deleted the fix/62-old-descriptor-crash branch April 28, 2017 17:53
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 34.589% when pulling 349c620 on fix/62-old-descriptor-crash into 78b10a9 on develop.

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.

2 participants