mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
server: Use wtfnode to log reasons why node isn't exiting
This commit is contained in:
parent
ba81ead101
commit
877f0c5883
4 changed files with 19 additions and 2 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -870,7 +870,8 @@
|
||||||
"tinycon": "0.0.1",
|
"tinycon": "0.0.1",
|
||||||
"ueberdb2": "^1.2.5",
|
"ueberdb2": "^1.2.5",
|
||||||
"underscore": "1.8.3",
|
"underscore": "1.8.3",
|
||||||
"unorm": "1.4.1"
|
"unorm": "1.4.1",
|
||||||
|
"wtfnode": "^0.8.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": {
|
"@apidevtools/json-schema-ref-parser": {
|
||||||
|
@ -10577,6 +10578,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||||
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
|
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
|
||||||
},
|
},
|
||||||
|
"wtfnode": {
|
||||||
|
"version": "0.8.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/wtfnode/-/wtfnode-0.8.4.tgz",
|
||||||
|
"integrity": "sha512-64GEKtMt/MUBuAm+8kHqP74ojjafzu00aT0JKsmkIwYmjRQ/odO0yhbzKLm+Z9v1gMla+8dwITRKzTAlHsB+Og=="
|
||||||
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
const log4js = require('log4js');
|
const log4js = require('log4js');
|
||||||
log4js.replaceConsole();
|
log4js.replaceConsole();
|
||||||
|
|
||||||
|
// wtfnode should be loaded after log4js.replaceConsole() so that it uses log4js for logging, and it
|
||||||
|
// should be above everything else so that it can hook in before resources are used.
|
||||||
|
const wtfnode = require('wtfnode');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* early check for version compatibility before calling
|
* early check for version compatibility before calling
|
||||||
* any modules that require newer versions of NodeJS
|
* any modules that require newer versions of NodeJS
|
||||||
|
@ -211,6 +215,7 @@ exports.exit = async (err = null) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.error('Something that should have been cleaned up during the shutdown hook (such as ' +
|
console.error('Something that should have been cleaned up during the shutdown hook (such as ' +
|
||||||
'a timer, worker thread, or open connection) is preventing Node.js from exiting');
|
'a timer, worker thread, or open connection) is preventing Node.js from exiting');
|
||||||
|
wtfnode.dump();
|
||||||
console.error('Forcing an unclean exit...');
|
console.error('Forcing an unclean exit...');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}, 5000).unref();
|
}, 5000).unref();
|
||||||
|
|
5
src/package-lock.json
generated
5
src/package-lock.json
generated
|
@ -8659,6 +8659,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz",
|
||||||
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA=="
|
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA=="
|
||||||
},
|
},
|
||||||
|
"wtfnode": {
|
||||||
|
"version": "0.8.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/wtfnode/-/wtfnode-0.8.4.tgz",
|
||||||
|
"integrity": "sha512-64GEKtMt/MUBuAm+8kHqP74ojjafzu00aT0JKsmkIwYmjRQ/odO0yhbzKLm+Z9v1gMla+8dwITRKzTAlHsB+Og=="
|
||||||
|
},
|
||||||
"xml2js": {
|
"xml2js": {
|
||||||
"version": "0.4.23",
|
"version": "0.4.23",
|
||||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||||
|
|
|
@ -72,7 +72,8 @@
|
||||||
"tinycon": "0.0.1",
|
"tinycon": "0.0.1",
|
||||||
"ueberdb2": "^1.2.5",
|
"ueberdb2": "^1.2.5",
|
||||||
"underscore": "1.8.3",
|
"underscore": "1.8.3",
|
||||||
"unorm": "1.4.1"
|
"unorm": "1.4.1",
|
||||||
|
"wtfnode": "^0.8.4"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"etherpad-lite": "node/server.js"
|
"etherpad-lite": "node/server.js"
|
||||||
|
|
Loading…
Reference in a new issue