Skip to content
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

FlexiblePool ttl closes under MIN_SIZE workers #44

Open
woytam opened this issue Oct 24, 2019 · 1 comment
Open

FlexiblePool ttl closes under MIN_SIZE workers #44

woytam opened this issue Oct 24, 2019 · 1 comment

Comments

@woytam
Copy link

woytam commented Oct 24, 2019

Hi, I have found out, that Pool\Flexible with TTL closes processes under the count of Options:MIN_SIZE.
Example:

$options = [
	Options::MIN_SIZE	=> 1,
	Options::MAX_SIZE	=> 5,
	Options::TTL		=> 10,		// seconds
];
Flexible::create(new Process('exec php ...'), $loop, $options);

Pool starts with 1 worker, but after 10 seconds (Options::TTL) of inactivity, worker is closed and there is 0 workers at that time. Problem can be in function ttl, but I do not understand the logic of this function to make PR.

@WyriHaximus
Copy link
Owner

Ow that's interesting, let me dig into it and give you some pointers on how to test this if you'd like to make the PR. Or you can already make the PR with just the test for this and I'll give you the pointers on how to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants