Skip to content

Commit e5af40e

Browse files
committed
itest: fix shutdown error
Fixes an itest case where shutting down the client before a server connection to the auth mailbox server could be established lead to the cancellation being treated as a critical error, causing the test to fail.
1 parent 1845527 commit e5af40e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

authmailbox/receive_subscription.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ func (s *receiveSubscription) connectAndAuthenticate(ctx context.Context,
106106

107107
err := s.connectServerStream(ctx, initialBackoff, reconnectRetries)
108108
if err != nil {
109+
if errors.Is(err, ErrClientShutdown) {
110+
log.DebugS(ctx, "Client is shutting down, not "+
111+
"connecting to server stream")
112+
113+
// Allow the main server to identify this as the request
114+
// being canceled by the client. Which will cause the
115+
// error not to be treated as a fatal error.
116+
return context.Canceled
117+
}
109118
return fmt.Errorf("connecting server stream failed: %w", err)
110119
}
111120

0 commit comments

Comments
 (0)