Skip to content

Commit

Permalink
internal/servers/worker: actually return when aborting closeConnectio…
Browse files Browse the repository at this point in the history
…ns (#1371)

This adds a return when aborting from closeConnections, which should
have happened as a part of #1369.

Note that it's currently inconsequential that it's not happening right
now, save some misleading log entries. setCloseTimeForResponse will
effectively no-op on empty or nil input maps.
  • Loading branch information
vancluever authored Jun 30, 2021
1 parent 48e55f1 commit 77bafca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/servers/worker/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ func (w *Worker) closeConnections(ctx context.Context, closeInfo map[string]stri

if err != nil {
w.logger.Error(err.Error())
w.logger.Error("serious error in processing return data from controller, aborting marking connections as closed")
w.logger.Error("serious error in processing return data from controller, aborting additional session/connection state modification")
return
}

// Mark connections as closed
Expand Down
2 changes: 1 addition & 1 deletion internal/servers/worker/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestMakeFakeSessionCloseInfo(t *testing.T) {
require.Equal(expected, actual)
}

func TestMakeFakeSessionCloseInfoPanicIfCloseInfoNil(t *testing.T) {
func TestMakeFakeSessionCloseInfoErrorIfCloseInfoNil(t *testing.T) {
require := require.New(t)
actual, err := new(Worker).makeFakeSessionCloseInfo(nil)
require.Nil(actual)
Expand Down

0 comments on commit 77bafca

Please sign in to comment.