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

[mlflow/R] Retry 429s in R's res client. #1851

Merged

Conversation

tomasatdatabricks
Copy link
Contributor

What changes are proposed in this pull request?

Similarly to other clients, R should retry 429s.

How is this patch tested?

Unit test.

Release Notes

Rest client in R will now retry 429 codes (rate limit exceeded) with an exponential backoff.

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What component(s) does this PR affect?

  • UI
  • CLI
  • API
  • REST-API
  • Examples
  • Docs
  • Tracking
  • Projects
  • Artifacts
  • Models
  • Scoring
  • Serving
  • R
  • Java
  • Python

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

x <- mlflow_rest(client = client, max_rate_limit_interval = 2)
expect_equal(x$text, "text")
next_id <<- 1
x <- mlflow_rest(client = client, max_rate_limit_interval = 2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Looks like we test the exact same behavior twice? i.e.

    x <- mlflow_rest(client = client, max_rate_limit_interval = 2)
    expect_equal(x$text, "text")
    next_id <<- 1

is repeated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a slight difference, the first call does not reset nex_id so only the first call returns 429, the second call returns 200. Not sure if we need this as a separate test case though.

Copy link
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-io
Copy link

Codecov Report

Merging #1851 into master will increase coverage by 0.25%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1851      +/-   ##
==========================================
+ Coverage      83%   83.25%   +0.25%     
==========================================
  Files          20       20              
  Lines        1000     1009       +9     
==========================================
+ Hits          830      840      +10     
+ Misses        170      169       -1
Impacted Files Coverage Δ
R/tracking-rest.R 100% <0%> (ø) ⬆️
R/tracking-client.R 98.71% <0%> (+1.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ba290c...3b6a755. Read the comment docs.

@tomasatdatabricks tomasatdatabricks merged commit 50ef2c4 into mlflow:master Sep 17, 2019
@smurching smurching added the rn/none List under Small Changes in Changelogs. label Sep 30, 2019
avflor pushed a commit to avflor/mlflow that referenced this pull request Aug 22, 2020
* Added retries for 429s in the R  REST client and a test.

* Added retries of 429s to R client.

* nit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn/none List under Small Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants