altv-js-module icon indicating copy to clipboard operation
altv-js-module copied to clipboard

Server process.on events handling is broken

Open xxshady opened this issue 3 years ago • 3 comments

Description of the problem

process.on events are duplicated (rarely on server startup) and server freezes after resource restart

Reproduction steps

process.on("uncaughtException", (error) => {
  console.log("uncaughtException", error.stack);
});
setTimeout(() => { throw new Error("test") }, 0);
  1. restart resource

Expected behaviour

.

Additional context

No response

Operating system

Windows 11

Version

dev/10.0-dev4

Scope

server

xxshady avatar Mar 08 '22 16:03 xxshady

Still the case after NodeJS update?

LeonMrBonnie avatar Mar 16 '22 20:03 LeonMrBonnie

yes

xxshady avatar Mar 16 '22 21:03 xxshady

@LeonMrBonnie seems like handled exception with process.on("uncaughtException") in setImmediate even crashes v8

process.on("uncaughtException", (error) => {
  console.log("uncaughtException", error.stack);
});

setImmediate(() => {
    throw new Error('kek');
});

xxshady avatar Apr 07 '22 01:04 xxshady