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

The subclass of RetryPolicyFilter overriding the method apply_retry_policy fails to retry by setting 'retry_data[:retryable] = true' #76

Closed
AbelHu opened this issue Feb 7, 2017 · 4 comments

Comments

@AbelHu
Copy link
Member

AbelHu commented Feb 7, 2017

According to the comments of the method apply_retry_policy, the subclass of RetryPolicyFilter should override the method apply_retry_policy. If the apply_retry_policy of the subclass decides to retry by setting retry_data[:retryable] = true, the method should_retry? of RetryPolicyFilter will override this value in Line 46 so it fails to retry.

Suggest to change

    def should_retry?(response, retry_data)
      apply_retry_policy retry_data
      retry_data[:retryable] = retry_data[:count] <= @retry_count
      return false unless retry_data[:retryable]
      
      should_retry_on_local_error? retry_data
      should_retry_on_error? response, retry_data
      return false unless retry_data[:retryable]
      
      adjust_retry_parameter retry_data
    end

=>

    def should_retry?(response, retry_data)
      retry_data[:retryable] = false
      apply_retry_policy retry_data
      return false if retry_data[:count] > @retry_count
      
      retryable = retry_data[:retryable] || should_retry_on_local_error? retry_data || should_retry_on_error? response, retry_data
      return false unless retryable
      
      adjust_retry_parameter retry_data
    end
@yaxia
Copy link
Member

yaxia commented Feb 7, 2017

Thanks for your feedback. I will evaluate your solution and update the fix plan.

@yaxia
Copy link
Member

yaxia commented Feb 27, 2017

We will fix it in the upcoming release.

@yaxia
Copy link
Member

yaxia commented Feb 28, 2017

@AbelHu Please try 0.12.0-preview for the fix. Thanks.

@AbelHu
Copy link
Member Author

AbelHu commented Feb 28, 2017

@yaxia Thanks. We will have a try.

@vinjiang vinjiang closed this as completed Jun 5, 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

No branches or pull requests

3 participants