Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown extra connections #3280

Merged
merged 3 commits into from
Apr 11, 2019
Merged

Shutdown extra connections #3280

merged 3 commits into from
Apr 11, 2019

Conversation

manishrjain
Copy link
Contributor

@manishrjain manishrjain commented Apr 11, 2019

There is a race condition which allows multiple goroutines to cause connections to be created to other servers via conn.Connect. We only store one in a map and the rest just get dropped on the floor. However, they are still ticking and causing pings to the other servers. In a recent incident, we saw thousands of MonitorHealth goroutines, which is obviously a huge drain on resources.

This PR shuts down any connection which doesn't make it to the map, releasing resources correctly. Tested on live cluster.


This change is Reviewable

@manishrjain manishrjain requested a review from srfrog April 11, 2019 00:13
Copy link
Contributor

@srfrog srfrog left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@codexnull codexnull left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@srfrog srfrog left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@manishrjain manishrjain merged commit 9fd8bb9 into master Apr 11, 2019
@manishrjain manishrjain deleted the mrjn/shutdown-extra-conns branch April 11, 2019 01:13
manishrjain added a commit that referenced this pull request Apr 11, 2019
There is a race condition which allows multiple goroutines to cause connections to be created to other servers via `conn.Connect`. We only store one and the rest just get dropped on the floor. However, they are still ticking and causing pings to the other servers. In a recent incident, we saw thousands of `MonitorHealth` goroutines, which is obviously a huge drain on resources.

This PR shuts down any connection which doesn't make it to the map, releasing resources correctly. Tested on live cluster.
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
There is a race condition which allows multiple goroutines to cause connections to be created to other servers via `conn.Connect`. We only store one and the rest just get dropped on the floor. However, they are still ticking and causing pings to the other servers. In a recent incident, we saw thousands of `MonitorHealth` goroutines, which is obviously a huge drain on resources.

This PR shuts down any connection which doesn't make it to the map, releasing resources correctly. Tested on live cluster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants