diff --git a/server/server.go b/server/server.go index 9287f63ff39..c858974d8d2 100644 --- a/server/server.go +++ b/server/server.go @@ -4271,16 +4271,15 @@ func (s *Server) LDMClientByID(id uint64) error { c := s.clients[id] if c != nil { c.mu.Lock() + defer c.mu.Unlock() if c.opts.Protocol >= ClientProtoInfo && c.flags.isSet(firstPongSent) { // sendInfo takes care of checking if the connection is still // valid or not, so don't duplicate tests here. c.Debugf("sending Lame Duck Mode info to client") c.enqueueProto(c.generateClientInfoJSON(info)) - c.mu.Unlock() return nil } else { - c.mu.Unlock() return errors.New("ClientProtoInfo < ClientOps.Protocol or first pong not sent") } }