Unable to write to value log file: file already closed

What version of Go are you using (go version)?

$ go version
go version go1.15.6 linux/arm

What operating system are you using?

Raspberry Pi 3 w/32 bit Raspbian

uname -a output: Linux waterpi 4.19.118-v7+ #1311 SMP Mon Apr 27 14:21:24 BST 2020 armv7l GNU/Linux

What version of Badger are you using?

github.com/dgraph-io/badger/v2 v2.0.3

Does this issue reproduce with the latest master?

not sure

Steps to Reproduce the issue

I don’t have a reliable reproduction setup

What Badger options were set?

	opts := badger.DefaultOptions(dir).WithMaxTableSize(1024 * 1024 * 8).WithValueLogFileSize(1024 * 1024 * 8)
	//opts.ValueLogLoadingMode = options.FileIO
	bdb, err := badger.Open(opts)

What did you do?

Ran the collector binary on the Pi for many hours:

I eventually see log messages like

Jan 28 03:48:03 waterpi cx34collector[1607]: E0128 03:48:03.158113    1607 cx34collector.go:98] error writing CX34 snapshot to database: er\
ror writing value to database: Unable to write to value log file: "/home/pi/db/cx34db/000134.vlog": write /home/pi/db/cx34db/000134.vlog: f\
ile already closed 

If I restart the binary, the database opens and everything works for a while. Then the error occurs and all I see are errors in the log.

What did you expect to see?

If restarting the binary fixes it, badger should be able to repair itself.

What did you see instead?

See above