[Groonga-commit] droonga/express-droonga at 7f29afd [master] Don't create new connection while updating

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 20 12:27:28 JST 2015


YUKI Hiroshi	2015-04-20 12:27:28 +0900 (Mon, 20 Apr 2015)

  New Revision: 7f29afdda0fa03b227e0bd4d7c8aabd0be63f3b0
  https://github.com/droonga/express-droonga/commit/7f29afdda0fa03b227e0bd4d7c8aabd0be63f3b0

  Message:
    Don't create new connection while updating

  Modified files:
    lib/adapter/http.js

  Modified: lib/adapter/http.js (+8 -0)
===================================================================
--- lib/adapter/http.js    2015-04-20 12:25:48 +0900 (7c09939)
+++ lib/adapter/http.js    2015-04-20 12:27:28 +0900 (97c9749)
@@ -50,6 +50,14 @@ function createRequestResponseHandler(params) {
         return;
       }
       var connection = connectionPool.get();
+      if (!connection) {
+        // When the cluster members are changing, we cannot get
+        // actual connection for a member, so retry later.
+        setTimeout(function() {
+          processRequest();
+        }, CONNECTION_RETRY_INTERVAL);
+        return;
+      }
       var wrappedConnection = new wrapper.DroongaProtocolConnectionWrapper(connection, callback, options);
       if (definition.onRequest) {
         try {
-------------- next part --------------
HTML����������������������������...
Download 



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