geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

Stack overflow on large collections #95

Open me-ascii opened 11 years ago

me-ascii commented 11 years ago
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
RangeError: Maximum call stack size exceeded

Error on Model.all( {}, done ) when the collection of a few hundred (or a thousand) records

me-ascii commented 11 years ago

node@0.10.17 model@0.2.10

mde commented 11 years ago

Which adapter are you using? There's no use of nextTick in Model itself.

me-ascii commented 11 years ago

mongodb

mde commented 11 years ago

Ah, that's not entirely surprising. We use an older version of mongodb-wrapper. We have an open issue to upgrade it, but it hasn't been a huge priority. Would love a PR for that, if you're interested in helping out. In any case, if the next stable Node version breaks this, we'll definitely do the upgrade as a bugfix.

me-ascii commented 11 years ago

Thank you for clarification. But this error leads to crash of nodejs process. What it is possible to do with it?

kaeus commented 11 years ago

Having the same issue with the mongodb adapter node@0.10.19 model@0.3.1

Is there a temporary way to resolve this?

kaeus commented 11 years ago

I just overrode the dependency in the Model package to use the latest version of mongodb-wrapper. Suppose I'll keep an eye out for anything that breaks in doing so, but at least it fixed the current issue with my large dataset causing the stack overflow.

mde commented 11 years ago

Awesome. Could you give us a PR for the upgrade, if everything goes well with the new mongodb-wrapper?

me-ascii commented 11 years ago

What does "PR" mean?

mde commented 11 years ago

A GitHub 'pull request': https://help.github.com/articles/using-pull-requests

ben-ng commented 11 years ago

"Pull Request" - a way to send patches you make back to the original project. You'll see a big green button in your fork after you've made a change prompting you to make a pull request. I think it's labeled "compare and merge" now.

me-ascii commented 11 years ago

Oh, PR its pull request, of course : ) sorry, for lame question

mde commented 11 years ago

We've upgraded to node-mongodb-native in the master branch. Could somebody verify if this is still a problem after the update?