Navigation Menu

Skip to content

Commit

Permalink
Output more logs while updating clsuter members
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Apr 20, 2015
1 parent 8eaa56d commit f1849c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/droonga-protocol/connection-pool.js
Expand Up @@ -125,9 +125,11 @@ ConnectionPool.prototype = {
},

getEnginesFromCluster: function(retryCount) {
this._logger.info('Getting engine names from cluster.');
if (this._watching)
return this.getEnginesFromClusterMember(this._serf.rpcAddress);

this._logger.info('Not watching: getting engine names from predetected member.');
retryCount = retryCount || 0;
var hostName = this._hostNames[retryCount];
if (!hostName)
Expand All @@ -142,12 +144,13 @@ ConnectionPool.prototype = {
return engines;
})
.catch((function(error) {
this._logger.error('Failed to get the list of droonga-engine hosts from the cluster member ' + hostName + '.');
this._logger.error('Failed to get the list of droonga-engine hosts from the cluster member ' + hostName + '. Retrying...');
this._logger.error(error);
return this.getEnginesFromCluster(retryCount + 1);
}).bind(this));
},
getEnginesFromClusterMember: function(rpcAddress) {
this._logger.info('Getting engine names from a cluster member ' + rpcAddress + '.');
return Q.Promise((function(resolve, reject, notify) {
if (!rpcAddress)
reject(new Error('no RPC address is given'));
Expand Down Expand Up @@ -204,6 +207,7 @@ ConnectionPool.prototype = {
if (this.updating)
return Q.Promise.resolve();

this._logger.info('Starting to update host names.');
this.updating = true;
return this.getEnginesFromCluster()
.then((function(engines) {
Expand Down

0 comments on commit f1849c5

Please sign in to comment.