-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoscaledPool cannot grow anymore #39
Comments
Thank you for reporting. We will investigate the issue and fix it shortly. |
Ad second issue: This is because Autoscaled pool is configured to finish when there is no task in progress and workerFunction returns null. We will add configuration parameter to leave pool running in this case and new method to finish it manually. Ad first issue: I did some tests and it seems to be working correctly. It looks for spare capacity and tries to run new worker functions everytime some of the function gets finished. And also there is interval every 1s that looks for spare capacity and possible starts new worker functions. In your example you are adding new task every 900ms and tasks takes 1000s so there should be about 1 task running the most of the time. |
Thanks for the details. For the first issue I now understand the reason. Would be worth to be mentioned in the docs! |
Definitely! Ill update the docs.
po 19. 3. 2018 v 17:40 odesílatel Soufiane Ghzal <notifications@github.com>
napsal:
… Thanks for the details.
For the first issue I now understand the reason. Would be worth to be
mentioned in the docs!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkTcUyKaR8Fn3vWoBsxEX7sjpcMec_Qks5tf9-XgaJpZM4SuAux>
.
|
Hi,
I made some experiments with the AutoscaledPool and found that it has issues when the worker function depends on an external source.
There are two mains issues:
The following example illustrates it: you initially have 2 worker running, while workers are running you add more workers, but one of them will terminate before data are available, so all the data that remain are run by only 1 worker when we would ecpect it to grow again.
To address this issue, the simplerst solution I can imagine would be to have the ability to notice the pool that new data are available for worker function and so that the pool tries to grow again. That could be achieved by a simple method call example:
pool.tryAddWorker()
or by having a callback function that would be looped and tested when workers are waiting, when it returns true a new worker is added (unless maxConcurency is reached) like that:To reproduce this issue, use the same code as above, but make the time in setInterval greater than the timeout in the promise.
To adresse this issue I could imagine to have the ability to flag the pool as "non ready to stop", in which case it would stay alive and will wait for an opportunity to grow until it's not flagged anymore as "non ready to stop".
The text was updated successfully, but these errors were encountered: