fix(storage): propagate ctx from invoke to grpc upload reqs#11475
Conversation
LGTM. The stashed context was mirroring the implementation as of Nov 2024, which also stashed a context (and also didn't use run): google-cloud-go/storage/grpc_client.go Line 2030 in 19f01c3 |
Re: #11200 , that was expected, @BrennaEpp re-implemented the retry/backoff behavior in the private repo given the large changes in uploads overall. |
+1, when I introduced run to get the backoff I didn't think about the ctx from run being lost; really, it has never used that ctx and this change adds it in. |
The context from
run(seeinvoke.go) is not being used for gRPC uploads.Rather than keep a source of truth in a writer var (except for the original context), pass through contexts.
The other option is to keep as is and instead do the following. This may be "safer" (at least in terms of, more likely to keep current behaviour) as it is hard to follow exactly how these contexts are behaving currently.
bucketContextalso changed to be called once for ALL grpc upload types.