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

Deadlock with tsm1 engine #6271

Closed
PierreF opened this issue Apr 8, 2016 · 1 comment
Closed

Deadlock with tsm1 engine #6271

PierreF opened this issue Apr 8, 2016 · 1 comment

Comments

@PierreF
Copy link
Contributor

PierreF commented Apr 8, 2016

During a stress testing of InfluxDB 0.11 cluster, it got stuck and all queries timed-out. During this test, I was sending writes, read (and also drop series).
I could see that number of active queries were high and didn't reduced even long time after stopping the stress tools.

After few search, I think this issue a a deadlock on a RWMutex in file_store.go:

  • 1 thread get a RLock (in my case, it's FileStore.KeyCursor)
  • another thread try to get a Lock (in my case it's FileStore.Replace) - this get blocked since first thread has a RLock
  • the first thread try to acquire the RLock a second time (in FileStore.locations). This hang because the second thread is blocked on the Lock (https://golang.org/pkg/sync/#RWMutex.Lock : "a blocked Lock call excludes new readers from acquiring the lock")

To diagnose this issue, I've killed one a the InfluxDB node that got stuck with a SIGQUIT. Interesting part of the stacktrace is at https://gist.github.com/PierreF/7ed3ade69d56d04b48e8e22bfead43d5

Exact InfluxDB version : InfluxDB v0.11.1 (git: 0.11 57d625f)

This issue should still exists in 0.12, since FileStore.KeyCursor still get a RLock and call FileStore.locations (thought KeyCursor) which also get a RLock.

@e-dard
Copy link
Contributor

e-dard commented Apr 14, 2016

Fixed via #6277

@e-dard e-dard closed this as completed Apr 14, 2016
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

No branches or pull requests

2 participants