Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

avoid spawning goroutines for canceled dials #95

Merged
merged 1 commit into from
Jan 23, 2019

Conversation

Stebalien
Copy link
Member

This may speed up working through our dial queue a bit (but probably isn't the main issue).

This may speed up working through our dial queue a bit (bit probably isn't the
main issue).
@ghost ghost assigned Stebalien Jan 23, 2019
@ghost ghost added the status/in-progress In progress label Jan 23, 2019

// Skip over canceled dials instead of queuing up a goroutine.
if next.cancelled() {
dl.freePeerToken(next)
Copy link
Member

Choose a reason for hiding this comment

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

Good catch, the peer token wasn't being freed in the case of a cancellation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that was the issue. We'd (a) spawn an executeDial goroutine and then (b) free the token when we returned from it. This PR just avoids spawning goroutines that we don't need.

@Stebalien Stebalien merged commit 9b27a66 into master Jan 23, 2019
@ghost ghost removed the status/in-progress In progress label Jan 23, 2019
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