Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Prevent blocked go routines to hang forever (issue #1332) #1333

Merged
merged 1 commit into from
May 29, 2019
Merged

Conversation

replay
Copy link
Contributor

@replay replay commented May 28, 2019

This is not tested yet.

Fixes #1332

api/cluster.go Outdated
}, 1)
}

responses := make(chan response, len(peerGroups))
Copy link
Member

Choose a reason for hiding this comment

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

the responses chan doesnt need to be buffered.

@replay replay changed the title [WIP] prevent blocked go routines to hang forever (issue #1332) Prevent blocked go routines to hang forever (issue #1332) May 29, 2019
@replay
Copy link
Contributor Author

replay commented May 29, 2019

Tested in my QA instance and in the docker stack docker-cluster-query. Looks like everything is still working, so I'm merging.

@replay replay merged commit d1381fc into master May 29, 2019
@replay replay deleted the issue_1332 branch May 29, 2019 18:51
@Dieterbe
Copy link
Contributor

how does this solve the problem?
isn't it possible that the select case is blocked because neither of the 2 cases can continue?

@robert-milan
Copy link
Contributor

The problem it solves it more related to how the method was exiting, and leaving running goroutines with absolutely no way to proceed. The goroutines would be blocked on a channel that they could never send to. They were all getting deadlocked. This way, the ctx will finish at some point and those goroutines will now exit.

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.

We sometimes see a lot of go routines hanging in the function peerQuerySpeculativeChan()
4 participants