-
Notifications
You must be signed in to change notification settings - Fork 87
chore: add new request idempotency header x-goog-gcs-idempotency-token #2027
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
Conversation
879135e to
b90f446
Compare
Page bucket's token will be taken care of by the generator updates that will come in the near future.
tritone
left a comment
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.
Overall looks great, couple small questions based on my weak understanding of some java stuff...
| } | ||
|
|
||
| @NonNull | ||
| static GrpcCallContext newCallContext() { |
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.
Does this need a comment or more descriptive name clarifying that it adds the idempotency header? I think it could be confusing otherwise.
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.
Since this method is attached to the Retrying class, I feel it carries the context with it that the GrpcCallContext returned from this method contains things related to retries. I think the idempotency token is an implementation detail of what goes into the context.
| // 1. start resumable session | ||
| // 2. PUT first 256KiB | ||
| // 3. PUT second 256KiB | ||
| // 4. Finalize session and put final 45B |
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.
Just figured I'd ask because I am not great at following some of this testing code -- does the test assert that each of these 4 gets its own request ID, and that all retries for each request have the same ID?
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.
Mostly correct, we are asserting there is a distinct token for each of the 4 requests that are sent, however we are not inducing any failures in these tests to verify tokens are maintained for the same request across multiple attempts. Instead we are waiting on googleapis/storage-testbench#486 for the retry enforcement piece.
No description provided.