marcello3d / node-mongolian

[project inactive] Mongolian DeadBeef is an awesome Mongo DB driver for node.js
https://groups.google.com/group/node-mongolian
zlib License
349 stars 50 forks source link

Buffer is not large enough #72

Closed airs0urce closed 12 years ago

airs0urce commented 12 years ago

I have collection with just 151 elements (http://dl.dropbox.com/u/1875424/players_collection.txt). There is a problem with big amount of find command executions.

For example I run this code on collection I sent above:

setInterval(function() {
    db.collection('players').find({user_id: "1167876047"}).toArray(function(err, players) {});
}, 10);

As result I have this exception after couple seconds:

Error: Buffer is not large enough. Expected 8978944, have 71064
    at new Response (/usr/local/lib/node_modules/mongolian/node_modules/buffalo/lib/mongo.js:255:15)
    at Connection. (/usr/local/lib/node_modules/mongolian/lib/server.js:227:28)
    at Connection.emit (events.js:67:17)
    at Socket. (/usr/local/lib/node_modules/mongolian/lib/connection.js:61:22)
    at Socket.emit (events.js:67:17)
    at TCP.onread (net.js:341:14)
marcello3d commented 12 years ago

Nice catch. Edge case in the buffer stream handling.

qharlie commented 11 years ago

Hmm, I just got this using 1.1.18

Error: Buffer is not large enough. Expected 1702127876, have 36

Unfortunately I don't know where it came from, I'm catching bugs in production with on('uncaughtException') and the toString() only reports this.

Will do more research.

qharlie commented 11 years ago

This error is thrown when theres not enough memory to handle the query results? Or , when does this git thrown ?