Skip to content
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

api: Retry only request body is seekable #813

Merged
merged 1 commit into from Sep 20, 2017

Conversation

vadmeste
Copy link
Member

@vadmeste vadmeste commented Sep 19, 2017

It doesn't make sense to retry a HTTP request when its body is not
seekable. Req Body can be delivered by a developer such as in
PutObject() API.

Partially fix - ref #791

api.go Outdated
// Retry executes the following function body if request has an
// error until maxRetries have been exhausted, retry attempts are
// performed after waiting for a given period of time in a
// binomial fashion.
if isRetryable {
if isSeekable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the variable name? @vadmeste isRetryable is fine here. isSeekable is not providing any meaning. Its also not associated with what this PR tries to fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the variable name? @vadmeste isRetryable is fine here. isSeekable is not providing any meaning. Its also not associated with what this PR tries to fix.

Yeah, it is a simple change, I thought isSeekable is more precise than isRetryable, will revert

api.go Outdated
// Retry only when reader is seekable
reqRetry := MaxRetry
if !isSeekable {
reqRetry = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set this value perhaps in above metadata.contentBody fold itself. Avoids having multiple ifs.

It doesn't make sense to retry a HTTP request when its body is not
seekable. Req Body can be delivered by a developer such as in
PutObject() API.
@harshavardhana harshavardhana merged commit e981fb8 into minio:master Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants