add further error handling for rpc connection handling

This commit is contained in:
Chelsea Holland Komlo 2018-03-30 14:05:00 -04:00
parent 94a9cf6a19
commit 402a026c88

View file

@ -476,7 +476,16 @@ func (s *Server) reloadTLSConnections(newTLSConfig *config.TLSConfig) error {
s.connPool.ReloadTLS(tlsWrap) s.connPool.ReloadTLS(tlsWrap)
// reinitialize our rpc listener // reinitialize our rpc listener
s.rpcListener.Close() if s.rpcListener == nil {
s.logger.Println("Unable to reload configuration due to uninitialized rpc listner")
return nil
}
if err := s.rpcListener.Close(); err != nil {
s.logger.Printf("[ERR] nomad: Unable to close rpc listener %s", err)
return err
}
<-s.listenerCh <-s.listenerCh
s.startRPCListener() s.startRPCListener()