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

Introduce parallel rollout processing #2248

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

denislavprinov
Copy link
Contributor

@denislavprinov denislavprinov commented Jan 28, 2025

  • Introduce a ThreadPoolTaskExecutor for parallel rollout execution
  • Introduce a BlockWhenFullPolicy RejectedExecutionHandler to block scheduler submissions if all threads (default : 2) are occupied.

Current default behaviour is preserved if the thread pool size is <=1 (default thread pool size value is 1). If parallel execution is needed, the hawkbit.rollout.executor.thread-pool.size property should be set to a value > 1

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
@hawkbit-bot
Copy link

Can one of the admins verify this patch?

… Changing to previous default behaviour when the thread pool size is <=1

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
final RolloutHandler rolloutHandler, final SystemSecurityContext systemSecurityContext) {
return new RolloutScheduler(rolloutHandler, systemManagement, systemSecurityContext);
final RolloutHandler rolloutHandler, final SystemSecurityContext systemSecurityContext, @Value("${hawkbit.rollout.executor.thread-pool.size:1}") int threadPoolSize) {
return new RolloutScheduler(rolloutHandler, systemManagement, systemSecurityContext, threadPoolSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

make it final

import java.util.concurrent.ThreadPoolExecutor;

public class BlockWhenFullPolicy implements RejectedExecutionHandler {
@Override
Copy link
Contributor

Choose a reason for hiding this comment

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

4 spaces indents, please use hawkbit formatter

this.systemManagement = systemManagement;
this.rolloutHandler = rolloutHandler;
this.systemSecurityContext = systemSecurityContext;
this.rolloutTaskExecutor = threadPoolTaskExecutor(threadPoolSize);
Copy link
Contributor

Choose a reason for hiding this comment

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

this. is not needed

return null;
});
}

private void handleAll(String tenant) {
Copy link
Contributor

Choose a reason for hiding this comment

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

make it final

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.

4 participants