Skip to content

Commit

Permalink
Merge branch 'main' into update_protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafonseca committed Aug 6, 2024
2 parents 93e7864 + 21e7a69 commit c548b18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
7 changes: 6 additions & 1 deletion pkg/service/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pkg/service/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c548b18

Please sign in to comment.