Track goids when running with tracing enabled (#1413)

* Track goids when running with tracing enabled

* Linting
This commit is contained in:
Kegsay 2020-09-08 17:30:05 +01:00 committed by GitHub
parent 668a722ee0
commit b4bd0cc0f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View file

@ -60,6 +60,12 @@ func (w *ExclusiveWriter) run() {
if !w.running.CAS(false, true) {
return
}
if tracingEnabled {
gid := goid()
goidToWriter.Store(gid, w)
defer goidToWriter.Delete(gid)
}
defer w.running.Store(false)
for task := range w.todo {
if task.db != nil && task.txn != nil {