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
I've searched for any related issues and avoided creating a duplicate issue.
Description
Node.js offers an abortable API that can be used to implement abortable task in poolifier.
The issue with this API is that abort signal can't be transferred to workers as a transferable object for worker_threads, and the abortable API does not seem to be implemented in cluster module.
And aborting a task at the cost of killing the worker running it is not acceptable:
other tasks will be also stopped, abortables or not
cluster or worker_threads worker restart, which one of the main source of performance degradation, can lead to OOM condition if several abort signals are sent, ... .
Definitely not a proper solution for a worker pool aiming at performance and fine grained controlling and signalling about tasks lifecycle. And a pool not offering pre-instantiated stable processus/threads/workers to execute code block can't be called a pool ;-)
Alternatives solutions:
abort signal 'abort' trigger a message sent to the worker node handling the task and the logic to cancel it: queued => removed, executing => code handling the cancelation.
abort signal 'abort' trigger a 'message' using the IPC infrastructure with atomicity to come. Avoid the known bottlenecks on MessageChannel (worker_threads). Cluster IPC for messaging does not seem to be hitten by the same bottlenecks.
The API can be similar to the existing Node.js modules using abortable signal (although I'm not very fond of it).
Attachments
No response
The text was updated successfully, but these errors were encountered:
Duplicate issue
Description
Node.js offers an abortable API that can be used to implement abortable task in poolifier.
The issue with this API is that abort signal can't be transferred to workers as a transferable object for worker_threads, and the abortable API does not seem to be implemented in cluster module.
And aborting a task at the cost of killing the worker running it is not acceptable:
Definitely not a proper solution for a worker pool aiming at performance and fine grained controlling and signalling about tasks lifecycle. And a pool not offering pre-instantiated stable processus/threads/workers to execute code block can't be called a pool ;-)
Alternatives solutions:
The API can be similar to the existing Node.js modules using abortable signal (although I'm not very fond of it).
Attachments
No response
The text was updated successfully, but these errors were encountered: