incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Fix on http server startup, if another process has already started. The bad process would not shutdown correctly.
Date Tue, 30 Apr 2013 02:48:43 GMT
Fix on http server startup, if another process has already started.  The bad process would
not shutdown correctly.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/53cf9b12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/53cf9b12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/53cf9b12

Branch: refs/heads/0.1.5
Commit: 53cf9b125264c2a837c418288c887a6b3fd83496
Parents: 4b5a579
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Apr 29 22:47:45 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Apr 29 22:47:45 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/gui/HttpJettyServer.java  |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/53cf9b12/src/blur-gui/src/main/java/org/apache/blur/gui/HttpJettyServer.java
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/java/org/apache/blur/gui/HttpJettyServer.java b/src/blur-gui/src/main/java/org/apache/blur/gui/HttpJettyServer.java
index d930e16..cb8b16f 100644
--- a/src/blur-gui/src/main/java/org/apache/blur/gui/HttpJettyServer.java
+++ b/src/blur-gui/src/main/java/org/apache/blur/gui/HttpJettyServer.java
@@ -78,7 +78,8 @@ public class HttpJettyServer {
     context.setWar(warPath);
     context.setContextPath("/");
     context.setParentLoaderPriority(true);
-//    context.addServlet(new ServletHolder(new LiveMetricsServlet()), "/livemetrics");
+    // context.addServlet(new ServletHolder(new LiveMetricsServlet()),
+    // "/livemetrics");
     context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics");
     context.addServlet(new ServletHolder(new LogServlet(blurLogFile)), "/logs");
 
@@ -91,11 +92,16 @@ public class HttpJettyServer {
     try {
       server.start();
     } catch (Exception e) {
+      try {
+        server.stop();
+      } catch (Exception ex) {
+        LOG.error("Unknown error while trying to stop server during error on startup.", ex);
+      }
       throw new IOException("cannot start Http server for " + base, e);
     }
     LOG.info("WEB GUI up on port: " + port);
   }
-  
+
   public WebAppContext getContext() {
     return context;
   }


Mime
View raw message