From e553539b2aaf4d458b5e7883a77f9dfe7c849d96 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 13 Mar 2024 22:12:41 +0000 Subject: [PATCH] Clarify that process.exit() is a hack --- core/modules/commands/quit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/commands/quit.js b/core/modules/commands/quit.js index a43a3f066..cb086b8d4 100644 --- a/core/modules/commands/quit.js +++ b/core/modules/commands/quit.js @@ -25,6 +25,8 @@ var Command = function(params,commander,callback) { }; Command.prototype.execute = function() { + // The Node.js docs are unequivocal that exiting in this way can be dangerous because pending I/O is cancelled. + // It would be better to just stop the server listeners explicitly so that Node.js will exit the process naturally. process.exit(); return null; };