prevent double close due to error in creating listener
This commit is contained in:
parent
402a026c88
commit
a77dd08dd9
|
@ -487,7 +487,6 @@ func (s *Server) reloadTLSConnections(newTLSConfig *config.TLSConfig) error {
|
|||
}
|
||||
|
||||
<-s.listenerCh
|
||||
s.startRPCListener()
|
||||
|
||||
listener, err := s.createRPCListener()
|
||||
if err != nil {
|
||||
|
@ -495,6 +494,10 @@ func (s *Server) reloadTLSConnections(newTLSConfig *config.TLSConfig) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Ensure that the listener exists before potentially closing it after the
|
||||
// context for the nomad listener has exited
|
||||
s.startRPCListener()
|
||||
|
||||
// Close and reload existing Raft connections
|
||||
wrapper := tlsutil.RegionSpecificWrapper(s.config.Region, tlsWrap)
|
||||
s.raftLayer.ReloadTLS(wrapper)
|
||||
|
|
Loading…
Reference in New Issue