Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mc_cursor finishes returning before stopping
Prior to this, `mc_cursor` processes would shut down after returning the last result, rather than after returning a final 'empty' to callers. This caused callers to try to call back for 'next()' again when cursor was already down or going down. That call is a `gen_server:call()`. In the best case, the process would already be down, and the call would result in a `noproc` exit, which this code catches and translates into a return value of 'error', instead of the correct `{}` value. In rare cases, though, due to `gen_server` code, the call would occur at the moment the process terminates, and you'll get an `exit(normal)` on the calling process instead.
- Loading branch information