[
https://issues.apache.org/jira/browse/FLINK-5810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928746#comment-15928746
]
ASF GitHub Bot commented on FLINK-5810:
---------------------------------------
Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/3394#discussion_r106503546
--- Diff:
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotProtocolTest.java
---
@@ -68,115 +52,79 @@
public class SlotProtocolTest extends TestLogger {
- private static TestingSerialRpcService testRpcService;
+ private static ScheduledExecutorService scheduledExecutorService;
@BeforeClass
public static void beforeClass() {
- testRpcService = new TestingSerialRpcService();
+ scheduledExecutorService = new ScheduledThreadPoolExecutor(1);
}
@AfterClass
public static void afterClass() {
- testRpcService.stopService();
- testRpcService = null;
- }
+ scheduledExecutorService.shutdown();
+
+ if (!scheduledExecutorService.isTerminated()) {
+ List<Runnable> runnables =
scheduledExecutorService.shutdownNow();
- @Before
- public void beforeTest(){
- testRpcService.clearGateways();
+ for (Runnable runnable : runnables) {
+ runnable.run();
--- End diff --
I don't quite understand the logic in general: If there are pending tasks:
`shutdown()` does not affect them, and they will be returned in
`shutdownNow()`. If there are no pending tasks, it does not hurt to do
`shutdownNow()` immediately as well.
> Harden SlotManager
> ------------------
>
> Key: FLINK-5810
> URL: https://issues.apache.org/jira/browse/FLINK-5810
> Project: Flink
> Issue Type: Sub-task
> Components: Distributed Coordination
> Affects Versions: 1.3.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
>
> Harden the {{SlotManager}} logic to better cope with lost messages.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)