Skip to content

Commit

Permalink
fix(core): run CancellableStage cancel method on dedicated thread pool (
Browse files Browse the repository at this point in the history
  • Loading branch information
asher committed Sep 17, 2019
1 parent d671314 commit efe1163
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ public ThreadPoolTaskExecutor applicationEventTaskExecutor() {
return threadPool;
}

@Bean
public ThreadPoolTaskExecutor cancellableStageExecutor() {
ThreadPoolTaskExecutor threadPool = new ThreadPoolTaskExecutor();
threadPool.setThreadNamePrefix("cancel-");
threadPool.setCorePoolSize(5);
threadPool.setMaxPoolSize(10);
threadPool.setQueueCapacity(20);
return threadPool;
}

@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CancelStageHandler(
override val stageDefinitionBuilderFactory: StageDefinitionBuilderFactory,
override val stageNavigator: StageNavigator,

@Qualifier("messageHandlerPool") private val executor: Executor,
@Qualifier("cancellableStageExecutor") private val executor: Executor,
private val taskResolver: TaskResolver
) : OrcaMessageHandler<CancelStage>, StageBuilderAware, AuthenticationAware {

Expand Down

0 comments on commit efe1163

Please sign in to comment.