Skip to content

301 retries are logged as info#257

Merged
Bento007 merged 3 commits intomasterfrom
tsmith-retry-log-info
Mar 6, 2019
Merged

301 retries are logged as info#257
Bento007 merged 3 commits intomasterfrom
tsmith-retry-log-info

Conversation

@Bento007
Copy link
Copy Markdown
Collaborator

@Bento007 Bento007 commented Mar 5, 2019

Fixes #256

@Bento007 Bento007 self-assigned this Mar 5, 2019
Copy link
Copy Markdown
Contributor

@hannes-ucsc hannes-ucsc left a comment

Choose a reason for hiding this comment

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

Can't say yay/nay until tests are passing.

Comment thread hca/util/__init__.py Outdated
logger.warning("Retrying: {}".format(retry.history[-1]))
return retry
_retry = super(RetryPolicy, self).increment(*args, **kwargs)
last_resp = retry.history[-1]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can retry.history be empty?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not at this point in the code because super(RetryPolicy, self).increment(*args, **kwargs) appends the last request to history.

Comment thread hca/util/__init__.py Outdated
_retry = super(RetryPolicy, self).increment(*args, **kwargs)
last_resp = retry.history[-1]
if last_resp.status in {301}:
logger.info("Retrying: {}".format(last_resp))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might want to reduce the duplication between those two lines.

@Bento007 Bento007 requested a review from hannes-ucsc March 5, 2019 19:07
@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 5, 2019

Codecov Report

Merging #257 into master will decrease coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #257      +/-   ##
==========================================
- Coverage   83.73%   83.28%   -0.46%     
==========================================
  Files          37       37              
  Lines        1611     1615       +4     
==========================================
- Hits         1349     1345       -4     
- Misses        262      270       +8
Impacted Files Coverage Δ
hca/util/__init__.py 89.2% <100%> (+0.13%) ⬆️
hca/cli.py 64.42% <0%> (-7.7%) ⬇️

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 fc54575...b75b057. Read the comment docs.

Comment thread hca/util/__init__.py Outdated
Co-Authored-By: Bento007 <1429913+Bento007@users.noreply.github.com>
@Bento007 Bento007 merged commit 649c485 into master Mar 6, 2019
@Bento007 Bento007 deleted the tsmith-retry-log-info branch March 6, 2019 19:01
maniarathi pushed a commit that referenced this pull request Mar 28, 2019
* 301 retries are logged as info

* addressing comments

* Update hca/util/__init__.py

Co-Authored-By: Bento007 <1429913+Bento007@users.noreply.github.com>
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.

3 participants