Skip to content

Commit 158d927

Browse files
author
Ibrahim Jarif
authored
Remove second initialization of writech in Open (#1382)
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.
1 parent d37ce36 commit 158d927

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

db.go

-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ func Open(opt Options) (db *DB, err error) {
399399
db.orc.readMark.Done(db.orc.nextTxnTs)
400400
db.orc.incrementNextTs()
401401

402-
db.writeCh = make(chan *request, kvWriteChCapacity)
403402
db.closers.writes = y.NewCloser(1)
404403
go db.doWrites(db.closers.writes)
405404

0 commit comments

Comments
 (0)