Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: milo/appengine/logdog/build.go

Issue 2717623002: Milo: Handle missing / transient LogDog failures. (Closed)
Patch Set: remote unnecessary code Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/logdog/build.go
diff --git a/milo/appengine/logdog/build.go b/milo/appengine/logdog/build.go
index 43667b86f2dcf4c0c9ba1876b49dfc68bdb09d04..c6c69d44a8dc03081a7582f999d8c6d8f15a8574 100644
--- a/milo/appengine/logdog/build.go
+++ b/milo/appengine/logdog/build.go
@@ -12,7 +12,6 @@ import (
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/google"
miloProto "github.com/luci/luci-go/common/proto/milo"
- "github.com/luci/luci-go/grpc/grpcutil"
"github.com/luci/luci-go/logdog/api/logpb"
"github.com/luci/luci-go/logdog/client/coordinator"
"github.com/luci/luci-go/logdog/common/types"
@@ -25,7 +24,6 @@ import (
"github.com/golang/protobuf/proto"
mc "github.com/luci/gae/service/memcache"
"golang.org/x/net/context"
- "google.golang.org/grpc/codes"
)
const (
@@ -118,28 +116,11 @@ func (as *AnnotationStream) Fetch(c context.Context) (*miloProto.Step, error) {
state coordinator.LogStream
stream = as.Client.Stream(as.Project, as.Path)
)
- le, err := stream.Tail(c, coordinator.WithState(&state), coordinator.Complete())
- switch code := grpcutil.Code(err); code {
- case codes.OK:
- break
-
- case codes.NotFound:
- return nil, &miloerror.Error{
- Message: "Stream not found",
- Code: http.StatusNotFound,
- }
- default:
- // TODO: Once we switch to delegation tokens and are making the request on
- // behalf of a user rather than the Milo service, handle PermissionDenied.
- log.Fields{
- log.ErrorKey: err,
- "code": code,
- }.Errorf(c, "Failed to load LogDog annotation stream.")
- return nil, &miloerror.Error{
- Message: "Failed to load stream",
- Code: http.StatusInternalServerError,
- }
+ le, err := stream.Tail(c, coordinator.WithState(&state), coordinator.Complete())
+ if err != nil {
+ log.WithError(err).Errorf(c, "Failed to load stream.")
+ return nil, err
}
// Make sure that this is an annotation stream.

Powered by Google App Engine
This is Rietveld 408576698