internal/gensupport: SendRequestWithRetry sometimes spuriously makes requests when its context was canceled #1358
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
Steps to reproduce
SendRequestWithRetry
with a canceled contextgoogle-api-go-client/internal/gensupport/send.go
Lines 91 to 100 in 8fed2c8
Checking the context being done afterwards makes the issue go away.
Motivation
Some Cloud APIs expect callers to cancel the context if they want to cancel the operation, like
storage.(*ObjectHandle).NewWriter
. The spuriousness ofSendRequestWithRetry
sometimes causes spooky things to happen, like uploading a 0-byte object to GCS, where no object was desired or expected!The text was updated successfully, but these errors were encountered: