Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server+discovery: Only log errors if request was not cancelled #1837

Merged
merged 3 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#### Broadcaster

- \#1875 Update 'trying to transcode' log statement with manifestID (@kyriediculous)
- \#1837 Only log discovery errors when request is not cancelled (@yondonfu)

#### Orchestrator

Expand Down
8 changes: 6 additions & 2 deletions discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package discovery
import (
"container/heap"
"context"
"errors"
"math"
"math/rand"
"net/url"
Expand Down Expand Up @@ -85,8 +86,11 @@ func (o *orchestratorPool) GetOrchestrators(numOrchestrators int, suspender comm
infoCh <- info
return
}
if err != nil && monitor.Enabled {
monitor.LogDiscoveryError(err.Error())
if err != nil && !errors.Is(err, context.Canceled) {
glog.Error(err)
if monitor.Enabled {
monitor.LogDiscoveryError(err.Error())
}
}
errCh <- err
}
Expand Down
7 changes: 3 additions & 4 deletions server/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ func GetOrchestratorInfo(ctx context.Context, bcast common.Broadcaster, orchestr
req, err := genOrchestratorReq(bcast)
r, err := c.GetOrchestrator(ctx, req)
if err != nil {
glog.Errorf("Could not get orchestrator orch=%v err=%v", orchestratorServer, err)
return nil, errors.New("Could not get orchestrator err=" + err.Error())
return nil, errors.Wrapf(err, "Could not get orchestrator orch=%v", orchestratorServer)
}

return r, nil
Expand All @@ -238,8 +237,8 @@ func startOrchestratorClient(uri *url.URL) (net.OrchestratorClient, *grpc.Client
grpc.WithBlock(),
grpc.WithTimeout(GRPCConnectTimeout))
if err != nil {
glog.Errorf("Did not connect to orch=%v err=%v", uri, err)
return nil, nil, fmt.Errorf("Did not connect to orch=%v err=%v", uri, err)
return nil, nil, errors.Wrapf(err, "Did not connect to orch=%v", uri)

}
c := net.NewOrchestratorClient(conn)

Expand Down