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

[RB] Always cancel remote bazel run at end of CLI to prevent missing retries #8098

Open
wants to merge 1 commit into
base: rb_fix
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions cli/remotebazel/remotebazel.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,14 +877,9 @@ func Run(ctx context.Context, opts RunOpts, repoConfig *RepoConfig) (int, error)
log.Debugf("Invocation ID: %s", iid)

// If the remote bazel process is canceled or killed, cancel the remote run
isInvocationRunning := true
go func() {
<-ctx.Done()

if !isInvocationRunning {
return
}

// Use a non-cancelled context to ensure the remote executions are
// canceled
_, err = bbClient.CancelExecutions(context.WithoutCancel(ctx), &inpb.CancelExecutionsRequest{
Expand All @@ -905,7 +900,6 @@ func Run(ctx context.Context, opts RunOpts, repoConfig *RepoConfig) (int, error)
return 1, status.WrapError(err, "streaming logs")
}
}
isInvocationRunning = false

eg := errgroup.Group{}
var inRsp *inpb.GetInvocationResponse
Expand Down