christkv/node-mongodb-native — Issue #520: Infinite loop on exports.Connection.createDataHandler
Author: abdelsaid
Created: 2012-02-25 16:21:23+00:00
State: open

I'm getting an infinite loop and traced it to:
https://github.com/christkv/node-mongodb-native/blob/master/lib/mongodb/connection/connection.js#L189

Now, what do you suggest to trace the cause of the infinite loop? I think that method is doing more than what it supposed to do and needs to be cleaned/splitted into smaller methods. I'm willing to put some efforts to clean it up but I need some regression tests.

I did print trace info in that while loop and I get the following:

data.length: 1448
Trace:
at Socket. (/var/www/xyz/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:185:15)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:347:14)

and never stops displaying the same thing and my app hangs.