diff --git a/README.md b/README.md index 83e0a15c..67b3659f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Here's one example of running Pitaya: Start etcd (This command requires docker-compose and will run an etcd container locally. An etcd may be run without docker if preferred.) ``` -cd ./examples/testing && docker-compose up -d etcd +cd ./examples/testing && docker compose up -d etcd ``` run the connector frontend server from cluster_grpc example ``` diff --git a/pkg/service/handler.go b/pkg/service/handler.go index 1553dd52..d3155864 100644 --- a/pkg/service/handler.go +++ b/pkg/service/handler.go @@ -189,7 +189,12 @@ func (h *HandlerService) Handle(conn acceptor.PlayerConn) { } else if err == constants.ErrConnectionClosed { logger.Log.Debugf("Connection no longer available while reading next available message: %s", err.Error()) } else { - logger.Log.Errorf("Error reading next available message: %s", err.Error()) + // Differentiate errors for valid sessions, to avoid noise from load balancer healthchecks and other internet noise + if a.GetStatus() != constants.StatusStart { + logger.Log.Errorf("Error reading next available message for UID: %s, Build: %s, error: %s", a.GetSession().UID(), "a.GetSession().GetHandshakeData().Sys.BuildNumber", err.Error()) + } else { + logger.Log.Debugf("Error reading next available message on initial connection: %s", err.Error()) + } } return diff --git a/pkg/service/handler_test.go b/pkg/service/handler_test.go index 322170d3..a80e9984 100644 --- a/pkg/service/handler_test.go +++ b/pkg/service/handler_test.go @@ -418,16 +418,18 @@ func TestHandlerServiceHandle(t *testing.T) { mockAgent.EXPECT().SendHandshakeResponse().Return(nil) mockSession := mocks.NewMockSession(ctrl) + mockSession.EXPECT().GetHandshakeData().Return(&session.HandshakeData{Sys: session.HandshakeClientData{BuildNumber: "10"}}).AnyTimes() mockSession.EXPECT().SetHandshakeData(gomock.Any()).Times(1) mockSession.EXPECT().ValidateHandshake(gomock.Any()).Times(1) - mockSession.EXPECT().UID().Return("uid").Times(1) + mockSession.EXPECT().UID().Return("uid").AnyTimes() mockSession.EXPECT().ID().Return(int64(1)).Times(2) mockSession.EXPECT().Set(constants.IPVersionKey, constants.IPv4) mockSession.EXPECT().Close() mockAgent.EXPECT().String().Return("") + mockAgent.EXPECT().GetStatus().AnyTimes() mockAgent.EXPECT().SetStatus(constants.StatusHandshake) - mockAgent.EXPECT().GetSession().Return(mockSession).Times(7) + mockAgent.EXPECT().GetSession().Return(mockSession).AnyTimes() mockAgent.EXPECT().IPVersion().Return(constants.IPv4) mockAgent.EXPECT().RemoteAddr().Return(&mockAddr{}).AnyTimes() mockAgent.EXPECT().SetLastAt().Do(func() {