From bc401c2a19839355a56b4653709e2a095b64e913 Mon Sep 17 00:00:00 2001 From: idanasulinStrech Date: Wed, 31 May 2023 11:22:44 +0300 Subject: [PATCH] bugfix - broker crashes when getting connections on start up --- server/parser.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/parser.go b/server/parser.go index 70adaa6d4..b7af2cc12 100644 --- a/server/parser.go +++ b/server/parser.go @@ -18,6 +18,7 @@ import ( "bytes" "encoding/json" "fmt" + "memphis/db" "net/http" "net/textproto" "strings" @@ -946,6 +947,9 @@ func (c *client) parse(buf []byte) error { !strings.Contains(c.opts.Name, "NATS CLI") && !c.isWebsocket() && !strings.Contains(c.opts.Name, "MEMPHIS HTTP LOGGER") { + if db.MetadataDbClient.Client == nil { // server is not ready yet to get new connections + goto authErr + } if err := handleConnectMessage(c); err != nil { // user is getting notified from within the function goto authErr