diff options
author | Nick Thomas <nick@gitlab.com> | 2021-05-05 16:00:35 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2021-05-05 17:07:23 +0100 |
commit | d79d4777a88fcbf8f44771df76c4a6f1d3baa58b (patch) | |
tree | a62dc12af04fe38c0bd78d8247ffa3ccf1d7ad8e /internal/command/uploadpack/gitalycall.go | |
parent | 584643e0e10e0cbeee4f8366b5e50656dfee9ea4 (diff) | |
download | gitlab-shell-d79d4777a88fcbf8f44771df76c4a6f1d3baa58b.tar.gz |
Respect parent context for Gitaly calls
Without these changes, Gitaly calls would not be linked to a parent
context. This means that they would have an unassociated correlationID,
and Gitaly RPC calls would not be cancel()ed by parent context
cancellation.
Changelog: fixed
Diffstat (limited to 'internal/command/uploadpack/gitalycall.go')
-rw-r--r-- | internal/command/uploadpack/gitalycall.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/command/uploadpack/gitalycall.go b/internal/command/uploadpack/gitalycall.go index 5a8a605..a263fc4 100644 --- a/internal/command/uploadpack/gitalycall.go +++ b/internal/command/uploadpack/gitalycall.go @@ -12,7 +12,7 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/handler" ) -func (c *Command) performGitalyCall(response *accessverifier.Response) error { +func (c *Command) performGitalyCall(ctx context.Context, response *accessverifier.Response) error { gc := &handler.GitalyCommand{ Config: c.Config, ServiceName: string(commandargs.UploadPack), @@ -27,7 +27,7 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { GitConfigOptions: response.GitConfigOptions, } - return gc.RunGitalyCommand(func(ctx context.Context, conn *grpc.ClientConn) (int32, error) { + return gc.RunGitalyCommand(ctx, func(ctx context.Context, conn *grpc.ClientConn) (int32, error) { ctx, cancel := gc.PrepareContext(ctx, request.Repository, response, c.Args.Env) defer cancel() |