Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB "Cursor not found" even with no-timeout

Tags:

mongodb

go

Reported here, but I was told to post on StackOverflow

I'm trying to read the users from a forum database. Eventually, I want to put the data into PostgreSQL, but for now it just discards the data after reading it. My code is here.

The database is being told not to expire the cursor here, which calls this function, which sets no-timeout.

However, I'm getting an error here that says Cursor not found, cursor id: 28781399268 (the numbers change on every run) after going through about 96k of the 141k users.

like image 747
BenLubar Avatar asked Jul 05 '16 19:07

BenLubar


1 Answers

It turns out the Go MongoDB driver has a bug. I've submitted a fix here: https://github.com/go-mgo/mgo/pull/295

It was setting the NoCursorTimeout flag on the wire message, but not the noCursorTimeout property on the query.

like image 192
BenLubar Avatar answered Sep 18 '22 12:09

BenLubar