You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by fj...@apache.org on 2018/11/02 02:24:21 UTC

[incubator-druid] branch 0.13.0-incubating updated: fix exception in Supervisor.start causing overlord unable to become leader (#6516) (#6565)

This is an automated email from the ASF dual-hosted git repository.

fjy pushed a commit to branch 0.13.0-incubating
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/0.13.0-incubating by this push:
     new d5ffa3a  fix exception in Supervisor.start causing overlord unable to become leader (#6516) (#6565)
d5ffa3a is described below

commit d5ffa3a61f7232ae57eee8e16f6672ad706512b5
Author: Clint Wylie <cj...@gmail.com>
AuthorDate: Thu Nov 1 19:24:14 2018 -0700

    fix exception in Supervisor.start causing overlord unable to become leader (#6516) (#6565)
    
    * fix exception thrown by Supervisor.start causing overlord unable to become leader
    
    * fix style
---
 .../overlord/supervisor/SupervisorManager.java       |  7 ++++++-
 .../overlord/supervisor/SupervisorManagerTest.java   | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java
index cfca0de..f2c78a6 100644
--- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java
+++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManager.java
@@ -133,7 +133,12 @@ public class SupervisorManager
       for (String id : supervisors.keySet()) {
         SupervisorSpec spec = supervisors.get(id);
         if (!(spec instanceof NoopSupervisorSpec)) {
-          createAndStartSupervisorInternal(spec, false);
+          try {
+            createAndStartSupervisorInternal(spec, false);
+          }
+          catch (Exception ex) {
+            log.error(ex, "Failed to start supervisor: [%s]", spec.getId());
+          }
         }
       }
 
diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java
index 85cfd95..7ae3b99 100644
--- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java
+++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/supervisor/SupervisorManagerTest.java
@@ -229,6 +229,26 @@ public class SupervisorManagerTest extends EasyMockSupport
   }
 
   @Test
+  public void testStartIndividualSupervisorsFailStart()
+  {
+    Map<String, SupervisorSpec> existingSpecs = ImmutableMap.of(
+        "id1", new TestSupervisorSpec("id1", supervisor1),
+        "id3", new TestSupervisorSpec("id3", supervisor3)
+    );
+
+
+    EasyMock.expect(metadataSupervisorManager.getLatest()).andReturn(existingSpecs);
+    supervisor3.start();
+    supervisor1.start();
+    EasyMock.expectLastCall().andThrow(new RuntimeException("supervisor explosion"));
+    replayAll();
+
+    manager.start();
+
+    // if we get here, we are properly insulated from exploding supervisors
+  }
+
+  @Test
   public void testStopThrowsException()
   {
     Map<String, SupervisorSpec> existingSpecs = ImmutableMap.of(


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org