wangyang0918 commented on a change in pull request #9106: [FLINK-13184][yarn]
Support launching task executors with multi-thread on YARN.
URL: https://github.com/apache/flink/pull/9106#discussion_r308663264
##########
File path:
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java
##########
@@ -186,6 +197,11 @@ public YarnResourceManager(
this.slotsPerWorker =
updateTaskManagerConfigAndCreateWorkerSlotProfiles(flinkConfig,
defaultTaskManagerMemoryMB, numberOfTaskSlots);
setFailUnfulfillableRequest(true);
+
+ this.startContainerExecutor = new ThreadPoolExecutor(0,
flinkConfig.getInteger(YarnConfigOptions.CONTAINER_LAUNCHER_NUM_MAX),
+ 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new
ThreadFactoryBuilder()
+ .setNameFormat("ContainerLauncher #%d")
+ .build());
Review comment:
The default size of LinkedBlockingQueue is Integer.MAX_VALUE. Only when the
queue is full, the new threads will be started. Please refer to the java doc of
ThreadPoolExecutor. So i think we should use the FixedThreadPool instead.
Also, the executor service need to be shut down in postStop().
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services