[Groonga-commit] droonga/express-droonga at 0fa0d8b [master] Handle errors around Serf agent more safely

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 9 17:34:58 JST 2015


YUKI Hiroshi	2015-04-09 17:34:58 +0900 (Thu, 09 Apr 2015)

  New Revision: 0fa0d8b856bf0f33ea64a157240ad7db9b72d4f7
  https://github.com/droonga/express-droonga/commit/0fa0d8b856bf0f33ea64a157240ad7db9b72d4f7

  Message:
    Handle errors around Serf agent more safely

  Modified files:
    lib/serf/agent.js

  Modified: lib/serf/agent.js (+9 -1)
===================================================================
--- lib/serf/agent.js    2015-04-09 17:04:46 +0900 (8a7400e)
+++ lib/serf/agent.js    2015-04-09 17:34:58 +0900 (21763c3)
@@ -114,8 +114,15 @@ Agent.prototype.tryStart = function() {
       this._handleOutput(String(data));
     }).bind(this));
   } catch(error) {
-    this._agentProcess = null;
+    this._logger.error('Failed to start Serf agent.');
     this._logger.error(error);
+    try {
+      this._agentProcess.kill();
+    } catch(error) {
+      this._logger.error('Failed to stop Serf agent.');
+      this._logger.error(error);
+    }
+    this._agentProcess = null;
   }
 };
 
@@ -172,6 +179,7 @@ Agent.prototype.shutdown = function() {
       this._agentProcess = null;
       resolve();
     } catch(error) {
+      this._logger.error('Failed to stop Serf agent.');
       this._logger.error(error);
       reject(error);
     }
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index