Skip to content

Commit

Permalink
go/runtime: authorizer should fail-fast on context cancellation
Browse files Browse the repository at this point in the history
This fixes an infinite loop in AppendService which only stops itself on
context.Cancelled, and treats authorization errors as a retry-able
condition.
  • Loading branch information
jgraettinger committed Sep 5, 2024
1 parent 860ce29 commit 319acfc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions go/runtime/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ func (a *ControlPlaneAuthorizer) Authorize(ctx context.Context, claims pb.Claims
return value.apply(ctx)
}

// Fail-fast if the context is already done.
if ctx.Err() != nil {
return nil, ctx.Err()
}

// We must issue a new request to the authorization server.
// Begin by self-signing our request as a JWT.

Expand Down

0 comments on commit 319acfc

Please sign in to comment.