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
feat(storage): add retry config to the Client and HmacKey operations #5193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you'd like to discuss more about what surface makes sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple small things, generally looks good.
storage/hmac.go
Outdated
@@ -214,7 +215,12 @@ func (c *Client) CreateHMACKey(ctx context.Context, projectID, serviceAccountEma | |||
|
|||
setClientHeader(call.Header()) | |||
|
|||
hkPb, err := call.Context(ctx).Do() | |||
var hkPb *raw.HmacKey | |||
var err error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can inline this declaration
storage/hmac.go
Outdated
metadata, err = call.Context(ctx).Do() | ||
return err | ||
}) | ||
}, h.retry, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditionally idempotent based on whether the Etag is present in the metadata-- the user may pass it in HMACKeyAttrsToUpdate or not.
Are conformance tests catching this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be good now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more nit, otherwise LGTM
storage/retry_conformance_test.go
Outdated
if err != nil { | ||
return err | ||
if preconditions { | ||
k, err := key.Get(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get Etag from fs.hmacKey
rather than having another Get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good note!
No description provided.