Skip to content

fix: allow to burst threads by default #2262

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

Closed
wants to merge 5 commits into from
Closed

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Mar 5, 2024

The previous approach used a non-bound queue, therefore the thread were not added dynamically into the Threadpool.
As described in the docs of https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html
If the queue is not bounded, it will just accumulate the submitted tasks.

@csviri csviri requested a review from metacosm March 5, 2024 08:04
@openshift-ci openshift-ci bot requested review from adam-sandor and andreaTP March 5, 2024 08:04
@csviri csviri marked this pull request as draft March 5, 2024 08:18
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2024
csviri added 2 commits March 5, 2024 10:21
The current approach used a non-bound queue, therefore the thread were not added dynamically into the Threadpool

Signed-off-by: Attila Mészáros <csviri@gmail.com>
Signed-off-by: Attila Mészáros <csviri@gmail.com>
@csviri csviri force-pushed the executor-service-config branch from 032f39c to 856a00a Compare March 5, 2024 09:21
@csviri csviri changed the title fix: the executor service now uses SynchronousQueue fix: allow to burst Threads by default Mar 5, 2024
@csviri csviri marked this pull request as ready for review March 5, 2024 09:23
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2024
@csviri
Copy link
Collaborator Author

csviri commented Mar 5, 2024

This approach will lead to better startup performance. The ExecutorService can be replaced and fine-tuned.

IMO the best approach would be to have a pooled executor that increases the size as now to an upper bound on demand and then queues the remaining elements, which would cover the initial burst on startup nicely.
Maybe we could create an issue, but probably that would not be trivial to implement.

@csviri
Copy link
Collaborator Author

csviri commented Mar 5, 2024

This could be a change for v5, we don't need to necessarily release it as a bugfix.

csviri added 3 commits March 5, 2024 10:32
Signed-off-by: Attila Mészáros <csviri@gmail.com>
Signed-off-by: Attila Mészáros <csviri@gmail.com>
Signed-off-by: Attila Mészáros <csviri@gmail.com>
@csviri csviri changed the title fix: allow to burst Threads by default fix: allow to burst threads by default Mar 5, 2024
@csviri
Copy link
Collaborator Author

csviri commented Mar 6, 2024

replaced by: #2265

@csviri csviri closed this Mar 6, 2024
@metacosm metacosm deleted the executor-service-config branch March 6, 2024 15:35
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

Successfully merging this pull request may close these issues.

1 participant