Skip to content

Commit

Permalink
Remove second initialization of writech in Open (#1382)
Browse files Browse the repository at this point in the history
The `db.writeCh` is being initialized for the second time in `db.Open` which
causes a race condition. The write channel was being closed in the `doWrites`
goroutine earlier but that code was removed in
2b39009.
We no longer need the second initialization. See PR #1382 for full stack trace.
  • Loading branch information
Ibrahim Jarif committed Jun 23, 2020
1 parent d37ce36 commit 158d927
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion db.go
Expand Up @@ -399,7 +399,6 @@ func Open(opt Options) (db *DB, err error) {
db.orc.readMark.Done(db.orc.nextTxnTs)
db.orc.incrementNextTs()

db.writeCh = make(chan *request, kvWriteChCapacity)
db.closers.writes = y.NewCloser(1)
go db.doWrites(db.closers.writes)

Expand Down

0 comments on commit 158d927

Please sign in to comment.