Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1713 from endocode/dongsu/engine-fix-grpc-conn
Browse files Browse the repository at this point in the history
engine: fix a bug in engine being unreachable
  • Loading branch information
Dongsu Park authored Dec 2, 2016
2 parents f44f123 + 82dac98 commit 9e421a4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions engine/rpcengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,7 @@ func rpcAcquireLeadership(reg registry.Registry, lManager lease.Manager, machID
return l
}

// If reg is not ready, we have to give it an opportunity to steal lease
// below. Otherwise it could be blocked forever by the existing engine leader,
// which could cause gRPC registry to always fail when a leader already exists.
// Thus we return the existing leader, only if reg.IsRegistryReady() == true.
// TODO(dpark): refactor the entire function for better readability. - 20160908
if (existing != nil && existing.Version() >= ver) && reg.IsRegistryReady() {
if existing != nil && existing.Version() >= ver {
log.Debugf("Lease already held by Machine(%s) operating at acceptable version %d", existing.MachineID(), existing.Version())
return existing
}
Expand Down

0 comments on commit 9e421a4

Please sign in to comment.