From b4b12133a1986f431bfb82a5a1487f16cdd61bd9 Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Mon, 24 Jul 2023 07:28:23 +0200 Subject: [PATCH 1/5] feat: async task execution for cleanup --- .../config/AsyncConfigurationProperties.java | 109 ++++++++++++++++++ .../config/DataflowAsyncConfiguration.java | 42 +++++++ .../controller/TaskExecutionController.java | 2 + .../main/resources/META-INF/spring.factories | 3 +- 4 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java create mode 100644 spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java new file mode 100644 index 0000000000..4bd279a7a2 --- /dev/null +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java @@ -0,0 +1,109 @@ +package org.springframework.cloud.dataflow.server.config; + + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.cloud.dataflow.core.DataFlowPropertyKeys; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.concurrent.ExecutorConfigurationSupport; + +/** + * Used to configure the {@link ThreadPoolTaskExecutor} in {@link DataflowAsyncConfiguration}. For more information + * of the fields see {@link ThreadPoolTaskExecutor} and {@link ExecutorConfigurationSupport} + * + * @author Tobias Soloschenko + */ +@ConfigurationProperties(prefix = AsyncConfigurationProperties.ASYNC_PREFIX) +public class AsyncConfigurationProperties { + + public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "async"; + + private int corePoolSize = 1; + + private int maxPoolSize = Integer.MAX_VALUE; + + private int keepAliveSeconds = 60; + + private int queueCapacity = Integer.MAX_VALUE; + + private boolean allowCoreThreadTimeOut = false; + + private boolean prestartAllCoreThreads = false; + + private boolean waitForTasksToCompleteOnShutdown = false; + + private long awaitTerminationMillis = 0L; + + private String threadNamePrefix = "scdf-async-"; + + public int getQueueCapacity() { + return queueCapacity; + } + + public void setCorePoolSize(int corePoolSize) { + this.corePoolSize = corePoolSize; + } + + public int getMaxPoolSize() { + return maxPoolSize; + } + + public void setMaxPoolSize(int maxPoolSize) { + this.maxPoolSize = maxPoolSize; + } + + public int getKeepAliveSeconds() { + return keepAliveSeconds; + } + + public void setKeepAliveSeconds(int keepAliveSeconds) { + this.keepAliveSeconds = keepAliveSeconds; + } + + public void setQueueCapacity(int queueCapacity) { + this.queueCapacity = queueCapacity; + } + + public int getCorePoolSize() { + return corePoolSize; + } + + public boolean isAllowCoreThreadTimeOut() { + return allowCoreThreadTimeOut; + } + + public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) { + this.allowCoreThreadTimeOut = allowCoreThreadTimeOut; + } + + public boolean isPrestartAllCoreThreads() { + return prestartAllCoreThreads; + } + + public void setPrestartAllCoreThreads(boolean prestartAllCoreThreads) { + this.prestartAllCoreThreads = prestartAllCoreThreads; + } + + public boolean isWaitForTasksToCompleteOnShutdown() { + return waitForTasksToCompleteOnShutdown; + } + + public void setWaitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown) { + this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; + } + + public long getAwaitTerminationMillis() { + return awaitTerminationMillis; + } + + public void setAwaitTerminationMillis(long awaitTerminationMillis) { + this.awaitTerminationMillis = awaitTerminationMillis; + } + + public String getThreadNamePrefix() { + return threadNamePrefix; + } + + public void setThreadNamePrefix(String threadNamePrefix) { + this.threadNamePrefix = threadNamePrefix; + } +} diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java new file mode 100644 index 0000000000..34d9f7e71d --- /dev/null +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java @@ -0,0 +1,42 @@ +package org.springframework.cloud.dataflow.server.config; + +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.AsyncConfigurer; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; + +/** + * Class to override the executor at the application level. It also enables async executions for the Spring Cloud Data Flow Server. + * + * @author Tobias Soloschenko + */ +@Configuration(proxyBeanMethods = false) +@EnableAsync +@EnableConfigurationProperties(AsyncConfigurationProperties.class) +public class DataflowAsyncConfiguration implements AsyncConfigurer { + + private final AsyncConfigurationProperties asyncConfigurationProperties; + + public DataflowAsyncConfiguration(AsyncConfigurationProperties asyncConfigurationProperties) { + this.asyncConfigurationProperties = asyncConfigurationProperties; + } + + @Override + public Executor getAsyncExecutor() { + ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); + threadPoolTaskExecutor.setQueueCapacity(asyncConfigurationProperties.getQueueCapacity()); + threadPoolTaskExecutor.setCorePoolSize(asyncConfigurationProperties.getCorePoolSize()); + threadPoolTaskExecutor.setMaxPoolSize(asyncConfigurationProperties.getMaxPoolSize()); + threadPoolTaskExecutor.setKeepAliveSeconds(asyncConfigurationProperties.getKeepAliveSeconds()); + threadPoolTaskExecutor.setAllowCoreThreadTimeOut(asyncConfigurationProperties.isAllowCoreThreadTimeOut()); + threadPoolTaskExecutor.setPrestartAllCoreThreads(asyncConfigurationProperties.isPrestartAllCoreThreads()); + threadPoolTaskExecutor.setAwaitTerminationMillis(asyncConfigurationProperties.getAwaitTerminationMillis()); + threadPoolTaskExecutor.setThreadNamePrefix(asyncConfigurationProperties.getThreadNamePrefix()); + threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(asyncConfigurationProperties.isWaitForTasksToCompleteOnShutdown()); + threadPoolTaskExecutor.initialize(); + return threadPoolTaskExecutor; + } +} diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/TaskExecutionController.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/TaskExecutionController.java index bf71636247..d45389ca4d 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/TaskExecutionController.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/TaskExecutionController.java @@ -58,6 +58,7 @@ import org.springframework.hateoas.server.ExposesResourceFor; import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; import org.springframework.http.HttpStatus; +import org.springframework.scheduling.annotation.Async; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -265,6 +266,7 @@ public void cleanup(@PathVariable("id") Set ids, */ @RequestMapping(method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) + @Async public void cleanupAll( @RequestParam(defaultValue = "CLEANUP", name="action") TaskExecutionControllerDeleteAction[] actions, @RequestParam(defaultValue = "false", name="completed") boolean completed, diff --git a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/spring.factories b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/spring.factories index 30759fb529..a38df9d9d1 100644 --- a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/spring.factories @@ -5,7 +5,8 @@ org.springframework.boot.env.EnvironmentPostProcessor=\ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.cloud.dataflow.server.config.DataFlowServerAutoConfiguration,\ org.springframework.cloud.dataflow.server.config.DataFlowControllerAutoConfiguration, \ - org.springframework.cloud.dataflow.server.config.SpringDocAutoConfiguration + org.springframework.cloud.dataflow.server.config.SpringDocAutoConfiguration, \ + org.springframework.cloud.dataflow.server.config.DataflowAsyncConfiguration org.springframework.context.ApplicationContextInitializer=\ org.springframework.cloud.dataflow.common.flyway.FlywayVendorReplacingApplicationContextInitializer From d7257901abc7678356c38decec45024fe2074be4 Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Mon, 24 Jul 2023 12:56:14 +0200 Subject: [PATCH 2/5] fix: class headers --- .../config/AsyncConfigurationProperties.java | 17 +++++++++++++++- .../config/DataflowAsyncConfiguration.java | 20 +++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java index 4bd279a7a2..b2d36d6d8b 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java @@ -1,5 +1,20 @@ -package org.springframework.cloud.dataflow.server.config; +/* + * Copyright 2016-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.cloud.dataflow.server.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.cloud.dataflow.core.DataFlowPropertyKeys; diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java index 34d9f7e71d..c012b3c42d 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java @@ -1,13 +1,29 @@ +/* + * Copyright 2016-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.cloud.dataflow.server.config; +import java.util.concurrent.Executor; + import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import java.util.concurrent.Executor; - /** * Class to override the executor at the application level. It also enables async executions for the Spring Cloud Data Flow Server. * From 36ad9d5ebb552de3fec224ab3f706587eb00c326 Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Thu, 14 Sep 2023 06:42:14 +0200 Subject: [PATCH 3/5] fix: async cleanup review adjustments --- .../config/AsyncConfigurationProperties.java | 124 ------------------ .../config/DataflowAsyncConfiguration.java | 38 +++--- 2 files changed, 20 insertions(+), 142 deletions(-) delete mode 100644 spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java deleted file mode 100644 index b2d36d6d8b..0000000000 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/AsyncConfigurationProperties.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2016-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.dataflow.server.config; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.cloud.dataflow.core.DataFlowPropertyKeys; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import org.springframework.scheduling.concurrent.ExecutorConfigurationSupport; - -/** - * Used to configure the {@link ThreadPoolTaskExecutor} in {@link DataflowAsyncConfiguration}. For more information - * of the fields see {@link ThreadPoolTaskExecutor} and {@link ExecutorConfigurationSupport} - * - * @author Tobias Soloschenko - */ -@ConfigurationProperties(prefix = AsyncConfigurationProperties.ASYNC_PREFIX) -public class AsyncConfigurationProperties { - - public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "async"; - - private int corePoolSize = 1; - - private int maxPoolSize = Integer.MAX_VALUE; - - private int keepAliveSeconds = 60; - - private int queueCapacity = Integer.MAX_VALUE; - - private boolean allowCoreThreadTimeOut = false; - - private boolean prestartAllCoreThreads = false; - - private boolean waitForTasksToCompleteOnShutdown = false; - - private long awaitTerminationMillis = 0L; - - private String threadNamePrefix = "scdf-async-"; - - public int getQueueCapacity() { - return queueCapacity; - } - - public void setCorePoolSize(int corePoolSize) { - this.corePoolSize = corePoolSize; - } - - public int getMaxPoolSize() { - return maxPoolSize; - } - - public void setMaxPoolSize(int maxPoolSize) { - this.maxPoolSize = maxPoolSize; - } - - public int getKeepAliveSeconds() { - return keepAliveSeconds; - } - - public void setKeepAliveSeconds(int keepAliveSeconds) { - this.keepAliveSeconds = keepAliveSeconds; - } - - public void setQueueCapacity(int queueCapacity) { - this.queueCapacity = queueCapacity; - } - - public int getCorePoolSize() { - return corePoolSize; - } - - public boolean isAllowCoreThreadTimeOut() { - return allowCoreThreadTimeOut; - } - - public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) { - this.allowCoreThreadTimeOut = allowCoreThreadTimeOut; - } - - public boolean isPrestartAllCoreThreads() { - return prestartAllCoreThreads; - } - - public void setPrestartAllCoreThreads(boolean prestartAllCoreThreads) { - this.prestartAllCoreThreads = prestartAllCoreThreads; - } - - public boolean isWaitForTasksToCompleteOnShutdown() { - return waitForTasksToCompleteOnShutdown; - } - - public void setWaitForTasksToCompleteOnShutdown(boolean waitForTasksToCompleteOnShutdown) { - this.waitForTasksToCompleteOnShutdown = waitForTasksToCompleteOnShutdown; - } - - public long getAwaitTerminationMillis() { - return awaitTerminationMillis; - } - - public void setAwaitTerminationMillis(long awaitTerminationMillis) { - this.awaitTerminationMillis = awaitTerminationMillis; - } - - public String getThreadNamePrefix() { - return threadNamePrefix; - } - - public void setThreadNamePrefix(String threadNamePrefix) { - this.threadNamePrefix = threadNamePrefix; - } -} diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java index c012b3c42d..cc0de075f0 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java @@ -18,41 +18,43 @@ import java.util.concurrent.Executor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.task.TaskExecutorBuilder; +import org.springframework.cloud.dataflow.core.DataFlowPropertyKeys; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.AsyncConfigurer; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import static org.springframework.cloud.dataflow.server.config.DataflowAsyncConfiguration.ASYNC_PREFIX; + /** * Class to override the executor at the application level. It also enables async executions for the Spring Cloud Data Flow Server. * * @author Tobias Soloschenko */ @Configuration(proxyBeanMethods = false) +@ConditionalOnProperty(prefix = ASYNC_PREFIX, name = "enabled") @EnableAsync -@EnableConfigurationProperties(AsyncConfigurationProperties.class) -public class DataflowAsyncConfiguration implements AsyncConfigurer { +class DataflowAsyncConfiguration implements AsyncConfigurer { + + private static final Logger logger = LoggerFactory.getLogger(DataflowAsyncConfiguration.class); - private final AsyncConfigurationProperties asyncConfigurationProperties; + public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "task.cleanup.async"; - public DataflowAsyncConfiguration(AsyncConfigurationProperties asyncConfigurationProperties) { - this.asyncConfigurationProperties = asyncConfigurationProperties; + @Bean(name = "taskCleanupExecutor") + Executor taskCleanupExecutor(TaskExecutorBuilder taskExecutorBuilder) { + return taskExecutorBuilder.threadNamePrefix("TaskCleanup-").build(); } @Override - public Executor getAsyncExecutor() { - ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); - threadPoolTaskExecutor.setQueueCapacity(asyncConfigurationProperties.getQueueCapacity()); - threadPoolTaskExecutor.setCorePoolSize(asyncConfigurationProperties.getCorePoolSize()); - threadPoolTaskExecutor.setMaxPoolSize(asyncConfigurationProperties.getMaxPoolSize()); - threadPoolTaskExecutor.setKeepAliveSeconds(asyncConfigurationProperties.getKeepAliveSeconds()); - threadPoolTaskExecutor.setAllowCoreThreadTimeOut(asyncConfigurationProperties.isAllowCoreThreadTimeOut()); - threadPoolTaskExecutor.setPrestartAllCoreThreads(asyncConfigurationProperties.isPrestartAllCoreThreads()); - threadPoolTaskExecutor.setAwaitTerminationMillis(asyncConfigurationProperties.getAwaitTerminationMillis()); - threadPoolTaskExecutor.setThreadNamePrefix(asyncConfigurationProperties.getThreadNamePrefix()); - threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(asyncConfigurationProperties.isWaitForTasksToCompleteOnShutdown()); - threadPoolTaskExecutor.initialize(); - return threadPoolTaskExecutor; + public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { + return (throwable, method, objects) -> logger.error("Exception thrown in @Async Method " + method.getName(), + throwable); } } From e3c9052fdf88a43cad9f0209822793e82a6867db Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Thu, 14 Sep 2023 07:14:25 +0200 Subject: [PATCH 4/5] fix: more generic name for executor --- .../server/config/DataflowAsyncConfiguration.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java index cc0de075f0..10fe9f2d16 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java @@ -47,9 +47,11 @@ class DataflowAsyncConfiguration implements AsyncConfigurer { public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "task.cleanup.async"; - @Bean(name = "taskCleanupExecutor") - Executor taskCleanupExecutor(TaskExecutorBuilder taskExecutorBuilder) { - return taskExecutorBuilder.threadNamePrefix("TaskCleanup-").build(); + private static final String THREAD_NAME_PREFIX = "scdf-async-"; + + @Bean(name = "asyncExecutor") + Executor getAsyncExecutor(TaskExecutorBuilder taskExecutorBuilder) { + return taskExecutorBuilder.threadNamePrefix(THREAD_NAME_PREFIX).build(); } @Override From 8558609b4006a938062299c76b594acff7b5ed3e Mon Sep 17 00:00:00 2001 From: Tobias Soloschenko Date: Tue, 17 Oct 2023 08:12:17 +0200 Subject: [PATCH 5/5] fix: more generic prefix for properties --- .../dataflow/server/config/DataflowAsyncConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java index 10fe9f2d16..5b331c4f43 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowAsyncConfiguration.java @@ -45,7 +45,7 @@ class DataflowAsyncConfiguration implements AsyncConfigurer { private static final Logger logger = LoggerFactory.getLogger(DataflowAsyncConfiguration.class); - public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "task.cleanup.async"; + public static final String ASYNC_PREFIX = DataFlowPropertyKeys.PREFIX + "async"; private static final String THREAD_NAME_PREFIX = "scdf-async-";