-
Notifications
You must be signed in to change notification settings - Fork 33
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
PoolMetrics.allocatedSize
reports a different allocation count when the allocator uses threads
#172
Comments
I applied the test on reactor-pool 1.0.0, and the test also fails, so it is not a regression from reactor-pool 1.0.1. if my undertanding is correct, what happens is the following:
|
I'm not sure this is a bug per-se, it is mostly unexpected behavior and I'm not sure someone ever defined how much should be allocated. |
I'm also unsure. |
PR #173 for this issue was started (it's not yet finalized), however after more discussions with the team, it appears that, according to the javadoc of PoolBuilder.sizeBetween, It is not said that the resources must be kept to the minimum, it says that no more than max resources are created, and only
Moreover, the PR first waits for min resources to be created before allocating more resources, it means that So, we think that this the current behavior is correct based on the javadoc. |
Expected Behavior
When using a threaded scheduler like
Schedulers.parallel()
orSchedulers.single()
, the reported allocation size increments by one on a non-warmed pool. The pool allocates one element more than requested.Leaving out
subscribeOn(…)
or using an immediate scheduler doesn't show the reported behavior.Actual Behavior
The pool should not request additional items.
Steps to Reproduce
Possible Solution
Your Environment
netty
, ...):java -version
):uname -a
):The text was updated successfully, but these errors were encountered: