From 1b25419549015f57b64e8441983fef338158ecfc Mon Sep 17 00:00:00 2001 From: gofish2020 Date: Sat, 2 Dec 2023 00:04:34 +0800 Subject: [PATCH] fix#137 --- db.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db.go b/db.go index 682e8eee..964b6d3b 100644 --- a/db.go +++ b/db.go @@ -309,6 +309,12 @@ func (db *DB) waitMemtableSpace() error { return nil } + db.mu.Lock() + defer db.mu.Unlock() + if !db.activeMem.isFull() { + return nil + } + timer := time.NewTimer(db.options.WaitMemSpaceTimeout) defer timer.Stop() select {