healchow commented on code in PR #5852:
URL: https://github.com/apache/inlong/pull/5852#discussion_r977258424
##########
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/TopicBackendWorker.java:
##########
@@ -136,5 +140,6 @@ public void run() {
public void destroy() throws Exception {
runFlag.set(false);
nodeService.close();
+ this.workerExecutor.shutdown();
Review Comment:
Maybe use `shutdownNow()`?
##########
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/TopicBackendWorker.java:
##########
@@ -67,9 +71,10 @@ public class TopicBackendWorker implements DisposableBean,
Runnable {
TopicBackendWorker() {
Thread thread = new Thread(this);
- // daemon thread
- thread.setDaemon(true);
- thread.start();
+ this.workerExecutor = Executors
+ .newSingleThreadScheduledExecutor(
Review Comment:
Introducing a package just to use a ThreadFactory is not a good solution.
It is recommended to use the
`com.google.common.util.concurrent.ThreadFactoryBuilder` class from the guava
package to create a ThreadFactory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]