nsqio/go-diskqueue

an extra read after we finish reading a file

xianxueniao150 opened this issue · 1 comments

in "writeOne" method ,we move foward to next file according to the following condition
if d.writePos >= d.maxBytesPerFile { d.writeFileNum++ ... }

but in "readOne" method,we move foward to next file according to the following condition
if d.nextReadPos > d.maxBytesPerFile { ... d.nextReadFileNum++ }

This may cause an extra read after we finish reading a file, and this read will cause an "EOF" error

I think you might be looking at an older version of the code? Latest master is >= https://github.com/nsqio/go-diskqueue/blob/master/diskqueue.go#L343