From 1b369f2d1f29fbe45d2b730dcedacb5e35ba3c03 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 27 Sep 2022 09:49:53 -0700 Subject: [PATCH] don't log other stream errors at ERROR --- orca/producer.go | 6 +++--- orca/producer_test.go | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/orca/producer.go b/orca/producer.go index af44e6d75460..14e25edf6c42 100644 --- a/orca/producer.go +++ b/orca/producer.go @@ -169,7 +169,7 @@ func (p *producer) run(ctx context.Context) { // error. return case status.Code(err) == codes.Unimplemented: - // Unimplemented; do not retry. + // Unimplemented; do not retry and log at ERROR level. logger.Error("Server doesn't support ORCA OOB load reporting protocol; not listening for load reports.") return case status.Code(err) == codes.Unavailable: @@ -180,8 +180,8 @@ func (p *producer) run(ctx context.Context) { // exponential backoff mechanism, as we should know it's safe to // retry when the state is READY again. default: - // Log all other errors. - logger.Error("Received unexpected stream error:", err, ctx.Err()) + // Log all other stream errors. + logger.Info("Received unexpected stream error:", err, ctx.Err()) } } } diff --git a/orca/producer_test.go b/orca/producer_test.go index e62c62c2d55c..5bd50a0013c2 100644 --- a/orca/producer_test.go +++ b/orca/producer_test.go @@ -29,7 +29,6 @@ import ( "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/internal/grpctest" "google.golang.org/grpc/internal/testutils" "google.golang.org/grpc/orca" "google.golang.org/grpc/orca/internal" @@ -248,8 +247,6 @@ func (f *fakeORCAService) StreamCoreMetrics(req *v3orcaservicepb.OrcaLoadReportR // TestProducerBackoff verifies that the ORCA producer applies the proper // backoff after stream failures. func (s) TestProducerBackoff(t *testing.T) { - grpctest.TLogger.ExpectErrorN("injected error", 4) - ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel()