Skip to content

Commit

Permalink
xds: Return nil error after context cancel
Browse files Browse the repository at this point in the history
Do not return an error from xds server when the context is cancelled, as
this is part of normal operation, and we test for this in
server_e2e_test.

This resolves a test flake:

panic: Fail in goroutine after  has completed

Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
  • Loading branch information
jrajahalme authored and sayboras committed Apr 17, 2024
1 parent e8b940f commit c869e6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/envoy/xds/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (s *Server) processRequestStream(ctx context.Context, streamLog *logrus.Ent
switch chosen {
case doneChIndex: // Context got canceled, most likely by the client terminating.
streamLog.WithError(ctx.Err()).Debug("xDS stream context canceled")
return ctx.Err()
return nil

case reqChIndex: // Request received from the stream.
if !recvOK {
Expand Down

0 comments on commit c869e6c

Please sign in to comment.