Commit Graph

2 Commits (d52d9fb47a27cb764c9d40ae950f57d9c79f6863)

Author SHA1 Message Date
Jason Wilder fca3061f3c Make closing TSM cursors idempotent
Double closing a bufCursor would cause a panic.  There was also
some typed cursors that had the same problem.
2018-02-21 09:05:54 -07:00
Jonathan A. Sternberg a73c3a1965 Fix race condition in the merge iterator close method
If the close happens when next is being called, it can result in a race
condition where the current iterator gets set to nil after the initial
check.

This also fixes the finalizer so it runs the close method in a goroutine
instead of running it by itself. This is because all finalizers run on
the same goroutine so a close that takes a long time can cause a backup
for all finalizers. This also removes the redundant call to
`runtime.SetFinalizer` from the finalizer itself because a finalizer,
when called, has already cleared itself.
2017-11-27 16:55:41 -06:00