question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The DynamicThreadPool does not seem to revive new workers after they are killed

See original GitHub issue

We currently used DynamicThreadPool with min: 2, max: 8 workers. The workers start with 2 worker and after we used several workers, they scale up to 8 as expected. (maxInactiveTime) After 60 seconds of idle-time, they scale down and the exit-handler is fired. (worker.on('exit', ...) But if we then request some new workers after they were killed, it seems they don’t scale up to 8 again 🤔

We started to modified the code in node_modules and tried to just remove worker from this.workers, but it seems that this wasn’t enough to let it know to respawn new workers after they were killed

https://github.com/pioardi/poolifier/blob/5806029f3bdc6bc31d8cc8a611f77f5f3d2c1c88/lib/dynamic.js#L44-L49

The worker.on('online', ... event wasn’t fired again after the 8 workers scaled down to 2 and expected to re-scale up

I’m interested to help on this issue/bug, but currently you may know your code better and therefore could potentially identify the real problem more quickly

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
Shinigami92commented, Nov 12, 2020

We at adSoul are happy to inform you that everything is working now 🎉

1reaction
pioardicommented, Nov 11, 2020

Is ok, take your time 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

When will omp thread pool get destructed - Stack Overflow
If a native thread is destroyed at the end of a parallel region, a native-thread-end event occurs in the thread as the last...
Read more >
Configure the max worker threads Server Configuration Option
A worker thread is assigned only to active requests and is released once the request is serviced.
Read more >
Tuning the Size of Your Thread Pool - InfoQ
A properly sized thread pool should allow as many requests to run as the hardware and application can comfortably support. In other words,...
Read more >
Thread Pool in MariaDB
When the timer thread detects that a thread group is stalled, it wakes up a sleeping worker thread in the thread group, if...
Read more >
Python ThreadPool: The Complete Guide
Worker threads are designed to be re-used once the task is completed and provide protection against the unexpected failure of the task, such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found