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

Fix possible deadlock #5963

Merged
merged 4 commits into from
Mar 10, 2016
Merged

Fix possible deadlock #5963

merged 4 commits into from
Mar 10, 2016

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Mar 10, 2016

In a load test env, writes started timing out and filling up hinted handoff queues. The traces show hundreds of write goroutines blocked trying to acquire the tsdb.Store read lock. There were a few other goroutines stuck trying to acquire the tsdb.Store write lock in the periodic maintenance goroutine and during expanding sources during a query.

This change removes the maintenance goroutine because it is not used by tsm engine and just ends up locking the whole tsdb.Store periocially. This also switches the write lock taken during expanding sources to a read lock since that code only ever reads fields on the tsdb.Store.

  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

A write-lock was taken which locks the whole store during a query
that needs to expand sources.  Under load, writes can start to fail.
This is no longer used in tsm and just peridocially locks everything
for no reason now.
@jwilder
Copy link
Contributor Author

jwilder commented Mar 10, 2016

cc @benbjohnson

Make it consistent with other conventions where exported funcs
take a lock.
@joelegasse
Copy link
Contributor

LGTM 👍

jwilder added a commit that referenced this pull request Mar 10, 2016
@jwilder jwilder merged commit 998cb0a into master Mar 10, 2016
@pauldix
Copy link
Member

pauldix commented Mar 10, 2016

+1

@jwilder jwilder added this to the 0.11.0 milestone Mar 10, 2016
@benbjohnson
Copy link
Contributor

I'm late to the game but 👍 too

@jwilder
Copy link
Contributor Author

jwilder commented Mar 10, 2016

Cherry-picked to 0.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants