-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.2.0, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7
-
Component/s: Core
-
Empty show more show less
Hi,
header.writeInt32LE(this.requestId, 4); // requestID
requestId is used to write 2 bytes into header, but there is no limitation on how big this.requestId can be. It is growing with every message:
Msg.getRequestId = function() {
return ++_requestId;
};
And so, eventually it will reach maximum allowed value +1 (I guess 32767+1).
As node documentation is saying:
https://nodejs.org/api/buffer.html#buffer_buf_writeint32le_value_offset
value should be a valid signed 32-bit integer. Behavior is undefined when value is anything other than a signed 32-bit integer.
In reality it means error which cannot be fixed even by re-connection to database:
TypeError: "value" argument is out of bounds
at checkInt (buffer.js:1185:11)
at Buffer.writeInt32LE (buffer.js:1375:5)
at Msg.toBin (/node_modules/mongodb/node_modules/mongodb-core/lib/connection/msg.js:105:12)