Skip to content

Commit

Permalink
check error message code
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey Ivy committed Oct 28, 2024
1 parent f77a177 commit acedc53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/api/grpc/bes/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ func (s BuildEventServer) PublishBuildToolEventStream(stream build.PublishBuildE
SequenceNumber: sequenceNumber,
}); err != nil {

// with the option --bes_uplod_mode=fully_async or nowait_for_upload_complete
// with the option --bes_upload_mode=fully_async or nowait_for_upload_complete
// its not an error when the send fails. the bes gracefully terminated the close
// i.e. sent an EOF. for long running builds that take a while to save to the db (> 1s)
// the context is processed in the background, so by the time we are acknowledging these
// requests, the client connection may have already timed out and these errors can be
// safely ignored
if isClosing && (err.Error() != "rpc error: code = Unavailable desc = transport is closing") {
grpcErr := status.Convert(err)
if isClosing &&
grpcErr.Code() == codes.Unavailable &&
grpcErr.Message() == "transport is closing" {
return
}

Expand Down

0 comments on commit acedc53

Please sign in to comment.