Skip to content

Commit

Permalink
bugfix - broker crashes when getting connections on start up
Browse files Browse the repository at this point in the history
  • Loading branch information
idanasulin2706 committed May 31, 2023
1 parent ee8c140 commit bc401c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"memphis/db"
"net/http"
"net/textproto"
"strings"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bc401c2

Please sign in to comment.