Skip to content

Commit

Permalink
fix(kds): make error handling similar between GlobalToZoneSync and Zo…
Browse files Browse the repository at this point in the history
…neToGlobalSync (#10056)

Signed-off-by: Mike Beaumont <[email protected]>
  • Loading branch information
michaelbeaumont authored Apr 23, 2024
1 parent 6f32d26 commit 2017089
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/kds/mux/zone_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ func (g *KDSSyncServiceServer) ZoneToGlobalSync(stream mesh_proto.KDSSyncService
select {
case <-shouldDisconnectStream.Recv():
logger.Info("ending stream, zone health check failed")
return nil
return status.Error(codes.Canceled, "stream canceled - zone hc failed")
case <-stream.Context().Done():
logger.Info("ZoneToGlobalSync rpc stream stopped")
return nil
return status.Error(codes.Canceled, "stream canceled - stream stopped")
case <-g.context.Done():
logger.Info("app context done")
return status.Error(codes.Unavailable, "stream unavailable")
case err := <-processingErrorsCh:
if status.Code(err) == codes.Unimplemented {
return errors.Wrap(err, "ZoneToGlobalSync rpc stream failed, because Global CP does not implement this rpc. Upgrade Global CP.")
Expand Down

0 comments on commit 2017089

Please sign in to comment.