Thesharing commented on a change in pull request #17:
URL: https://github.com/apache/flink-benchmarks/pull/17#discussion_r658826482



##########
File path: 
src/main/java/org/apache/flink/scheduler/benchmark/SchedulerBenchmarkBase.java
##########
@@ -55,4 +58,10 @@ public static void runBenchmark(Class<?> clazz) throws 
RunnerException {
 
                new Runner(options).run();
        }
+
+
+       @TearDown
+       public void teardown() {
+               SchedulerBenchmarkUtils.shutdownTestingUtilDefaultExecutor();

Review comment:
       Sorry for making it confusing. 
   1. `TestingUtils.defaultExecutor()` is used in `DefaultSchedulerBuilder` by 
default. Since we use this builder to build a scheduler directly, we need to 
call `TestingUtils.defaultExecutor().shutdownNow()` to avoid the leak of the 
executor.
   2. `SchedulerBenchmarkBase` is only inherited by benchmarks located in 
`org.apache.flink.runtime.scheduler.benchmark.e2e`. Other scheduler benchmarks 
don't inherit this base class. To make it simple, I wrap 
`TestingUtils.defaultExecutor().shutdownNow();` into `SchedulerBenchmarkUtils` 
and call this method in `SchedulerBencmarkExecutorBase`. In this way we can 
make sure when `TestingUtils` is modified, this reference will be fixed 
together. 
   3. There's another option that we can add a base class for all the scheduler 
benchmarks. In this base class we add a method called `teardown`. But I think 
it's a bit more complicated.




-- 
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]


Reply via email to