You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a worker thread calls process.exit(), it doesn't seem like Piscina catches that, i.e. it doesn't restart the worker thread or anyhow marks it as "non-existing". I.e. the next job scheduled may be sent to that "zombie" worker and stuck there forever unnoticed.
Notice that if the worker thread is terminated on an error (e.g. with throw Error("ouch") in its setTimeout() handler, i.e. by producing a fatal uncaughtException), this is handled correctly. The only issue is with a worker exiting "successfully" (and this may actually happen due to some inaccurate written code or something).
Also, worker_threads supports on("exit") event, so there IS a way to catch process.exit() from the worker thread.
The text was updated successfully, but these errors were encountered:
If a worker thread calls process.exit(), it doesn't seem like Piscina catches that, i.e. it doesn't restart the worker thread or anyhow marks it as "non-existing". I.e. the next job scheduled may be sent to that "zombie" worker and stuck there forever unnoticed.
I found out that this code: https://github.com/piscinajs/piscina/blob/current/src/index.ts#L668 triggers in such a situation, but it doesn't remove the thread from the pool nor does anything else.
Notice that if the worker thread is terminated on an error (e.g. with
throw Error("ouch")
in its setTimeout() handler, i.e. by producing a fatal uncaughtException), this is handled correctly. The only issue is with a worker exiting "successfully" (and this may actually happen due to some inaccurate written code or something).Also, worker_threads supports on("exit") event, so there IS a way to catch process.exit() from the worker thread.
The text was updated successfully, but these errors were encountered: