diff --git a/lib/connection.js b/lib/connection.js index b0ceb77029b..f38647d855a 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -842,6 +842,11 @@ Connection.prototype._waitForConnect = async function _waitForConnect() { }, bufferTimeoutMS ); + + // dont cause this timeout to keep the js process alive + if ('unref' in timeout) { + timeout.unref(); + } }) ]);