-
Notifications
You must be signed in to change notification settings - Fork 60
Conversation
I don't think an error should cause random walk to stop - we don't really care about past errors for the purposes of random walk, we just want to walk the DHT to find new peers |
@dirkmc i |
I would say we should have a test for the opposite case - that the random walk does continue even if there's an error, but I would like to hear from @vasco-santos and @jacobheun if they know of a reason why it was written this way originally. |
I agree, there's no reason to stop the random walk on an error. The only reason the walk should stop is if the query is done or it timed out. |
Agree that it should keep going! |
fdea996
to
e5946d2
Compare
@vasco-santos @jacobheun ready to go |
fixed the conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for another PR @kumavis
Just left a minor request
Co-Authored-By: Vasco Santos <[email protected]>
@vasco-santos I'll handle the |
} catch (err) { | ||
this._kadDHT._log.error('random-walk:error', err) | ||
} | ||
// Each subsequent walk should run on a `this._options.interval` interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be checking this._timeoutId
has not been cleared after the walk has completed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point! We can check and not do the timeout
if needed.
switched over to a
_running
state var and andwhile(true)
async loop instead of managingtimeoutId
sskipped a test that was expecting queries to be run in series and that errors would stop the other queries. Should an error in
_walk
triggerrandomWalk
to stop? currently we log and ignoreupdates #82