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

improve: use fixed thread pool explicitly #2265

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Mar 6, 2024

Note that it was a fixed thread pool also now, just it was confusing with min and max values,

@@ -191,13 +200,11 @@ default Metrics getMetrics() {
}

default ExecutorService getExecutorService() {
return newThreadPoolExecutor(minConcurrentReconciliationThreads(),
concurrentReconciliationThreads());
return Executors.newFixedThreadPool(DEFAULT_RECONCILIATION_THREADS_NUMBER);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current approach is safe enough. If user want to get better startup performance, they can increase reconciliation thread number or override getExecutorService method

Copy link
Collaborator Author

@csviri csviri Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ysymi , using now the method to get the thread number instead of the static variable if you mean that.

Note that it was confusing that the concurrentReconciliationThreads() was ignored until now; the minConcurrentReconciliationThreads() was the size of a fixed thread pool at the end.

@csviri csviri requested a review from ysymi March 7, 2024 08:13
Signed-off-by: Attila Mészáros <csviri@gmail.com>
Signed-off-by: Attila Mészáros <csviri@gmail.com>
Signed-off-by: Chris Laprun <claprun@redhat.com>
@csviri csviri merged commit ab7c01f into main Mar 9, 2024
20 checks passed
@csviri csviri deleted the use-fixed-threadpool branch March 9, 2024 11:59
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.

3 participants