New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log4js 6.3 crashes on linux when using the multiprocess appender #1037
Comments
@nicojs There was an issue with the multiprocess appenders not listening to I also read your comments (stryker-mutator/stryker-js#2668 (comment)) suspecting it is due to multiple
|
Cool! Thanks! Indeed we do multiple calls to |
Be reminded that for multiple Keep an updated copy of your configuration (which you will keep changing) to pass into the Please do get back to us so we can close this issue. Thanks! 🙏 |
Thanks for reaching out @peteriman but I think there is a bug in 6.4 having to do with the multiprocess appender. I've boiled it down to a simple example: Main.js: // main.js
const childProcess = require("child_process");
const log4js = require("log4js");
log4js.configure({
appenders: {
console: {
type: "stdout",
layout: {
pattern: "%[%r (%z) %p %c%] %m",
type: "pattern",
},
},
server: {
appender: "console",
loggerPort: 43291,
mode: "master",
type: "multiprocess",
},
},
categories: {
default: {
appenders: ["console"],
level: "info",
},
},
});
const logger = log4js.getLogger("main");
logger.info("Start main logging server");
setTimeout(() => {
const worker = childProcess.fork(require.resolve("./worker.js"), {
stdio: "inherit",
});
worker.on("message", () => {
console.log("receiving msg");
setTimeout(() => {
console.log("killing worker");
worker.kill();
}, 1000);
});
}, 1000); Worker.js: // @ts-check
const log4js = require("log4js");
log4js.configure({
appenders: {
all: {
type: "multiprocess",
mode: "worker",
loggerPort: 43291,
},
},
categories: {
default: {
appenders: ["all"],
level: "info",
},
},
});
const logger = log4js.getLogger("worker");
logger.info("info test");
logger.warn("warn test");
logger.error("error test");
log4js.shutdown((err) => {
if (err) {
console.error(err);
}
console.log('sending msg')
process.send("done");
}); Expected (using version 6.2.1):
Actual:
Am I doing something obviously wrong? |
Same issue with the default logging config found in the docs (removing |
I found the issue, opening a PR. Also created a separate issue for it: #1161 |
Published Please verify if it fully resolves your issue and close this accordingly. 🙏 |
Our CI pipeline is green. That's all the proof I need :) |
Version 6.3 isn't working anymore for Stryker on linux. We're using the multiprocess appender. After starting it in worker mode we get these errors:
In CI/CD https://github.com/stryker-mutator/stryker/runs/941753327?check_suite_focus=true.
I was able to reproduce on WSL.
Will try to create detailed reproduction in the coming days. I don't see a lot of code changes, the only substantial commit seems to be 3cb7f52
I don't know why this would break the multiprocess appender. Maybe @nomiddlename already has a hunch? 😅
The text was updated successfully, but these errors were encountered: