Open mStirner opened 4 weeks ago
After restarting the backend, tasks down to 34 and the journal is flooded with disconnects:
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e567f84469378713d4ad1f/interfaces/66e567f84469378713d4ad21
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: [2024.10.28 - 16:57.55.640][debug][forwarder] Woker "ssdp.js" exited: 1006
Oct 28 16:57:55 open-haus.lan node[51700]: [2024.10.28 - 16:57.55.640][warn][forwarder] Worker exited with error, respawn
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a14572e58e7085f2a2e3/interfaces/66e4a14572e58e7085f2a2e4
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: Worker exited with code 0: http://127.0.0.1:8080/api/devices/66e4a0de72e58e7085f2a2db/interfaces/66e4a0de72e58e7085f2a2dc
Oct 28 16:57:55 open-haus.lan node[51700]: [2024.10.28 - 16:57.55.644][debug][forwarder] Woker "mdns.js" exited: 1006
Oct 28 16:57:55 open-haus.lan node[51700]: [2024.10.28 - 16:57.55.644][warn][forwarder] Worker exited with error, respawn
A quick fix would be a process.exit(1)
in the error listener:
sockets/tcp.js
const net = require("net");
module.exports = ({ host, port }) => {
const logger = require("../system/logger.js");
let socket = new net.Socket();
// keep socket alive
socket.setKeepAlive(true, 5000);
//socket.unref(); // test for #62, did nothing!
socket.on("error", (err) => {
logger.error(`[error] tcp://${host}:${port}`, err);
// why not cal process.exit() here?
// this file/function should only be called in a worker thread
// so it dosnt matter if the process exits or not...
// if the socket.unref() approach fails, try the exit method
process.exit(1);
});
socket.on("close", () => {
logger.debug(`[closed] tcp://${host}:${port}`);
});
socket.on("connect", () => {
logger.info(`[connected] tcp://${host}:${port}`);
});
socket.connect(port, host);
return socket;
};
Trying to connect to a invalid/non exisiting/offline tcp socket/server, causes to spwan worker, but do not exit. This creates a memory leak.
Related/debugging information: #61 A watch on
watch -n 10 "systemctl status connector"
and trying to connect to a offline raspberry increases the Tasks number continusly.start to watch:
16:23 = 49 16:25 = 51 16:28 = 54 16:33 = 63 16:37 = 69