Closed amw closed 11 years ago
I'm also seeing this issue.
@durran Have you seen this?
@amw Yes I am looking into it. It's actually not an Origin issue - it's that Moped doesn't handle this and Mongoid isn't passing the option through so I've got to fix it in both those repos.
Looks like no_timeout isn't being passed either, at least I'm still seeing a number of cursor timeouts when specifying no_timeout on the query.
Submitted a pull request to Moped and Mongoid that roughly implements this. Likely something I missed but it passes spec and seems to function properly.
Moped: https://github.com/mongoid/moped/pull/125 Mongoid: https://github.com/mongoid/mongoid/pull/2610
This has been handled in Mongoid and Moped.
It seems batch_size option is ignored in mongoid/origin.
Looking at rails log I would expect seeing GET MORE command every two documents, instead I see only one after 101 document (MongoDB default behavior). Like this:
Note that I set the batch size to 2 only for the purpose of this example. In my app I tried it with a value of 100.
This is a pretty big issue for me as my sample processing times out when I crunch through 1000 samples without touching the cursor. I don't want to set the no-timeout option on the cursor to avoid risking memory leaks if my app dies.