From 500927cbb1ab7b1f6f91cfa8cb9e858d796eac41 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Mon, 9 Dec 2013 15:01:42 -0800 Subject: [PATCH] consul: Leave does a RemovePeer RPC call --- consul/server.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/consul/server.go b/consul/server.go index 027c582840..1323e3772d 100644 --- a/consul/server.go +++ b/consul/server.go @@ -293,13 +293,12 @@ func (s *Server) Leave() error { } // Request that we are removed - // TODO: Properly forward to leader - future := s.raft.RemovePeer(s.rpcListener.Addr()) - - // Wait for the future ch := make(chan error, 1) go func() { - ch <- future.Error() + var out struct{} + peer := s.rpcListener.Addr().String() + err := s.connPool.RPC(leader, "Raft.RemovePeer", peer, &out) + ch <- err }() // Wait for the commit