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

proactively stop retrying tasks before max retries exception #7207

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

danlipert
Copy link
Contributor

Description

This PR stops exceptions that are thrown when minting or redeeming airdropped kudos, either due to network congestion or some other reason that causes the celery task to be retried. After the max retries are hit, we stop attempting to retry to the task.

Refers/Fixes

n/a

Testing

untested

@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #7207 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7207      +/-   ##
==========================================
- Coverage   26.18%   26.18%   -0.01%     
==========================================
  Files         297      297              
  Lines       29375    29377       +2     
  Branches     4339     4340       +1     
==========================================
  Hits         7693     7693              
+ Misses      21411    21408       -3     
- Partials      271      276       +5     
Impacted Files Coverage Δ
app/kudos/tasks.py 26.66% <0.00%> (-0.74%) ⬇️
app/quests/views.py 16.22% <0.00%> (ø)
app/dashboard/views.py 10.38% <0.00%> (ø)
...rketing/management/commands/no_applicants_email.py 0.00% <0.00%> (ø)
...eting/management/commands/assemble_leaderboards.py 39.73% <0.00%> (ø)

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 379eb6e...cc67783. Read the comment docs.

@thelostone-mc thelostone-mc merged commit 9d80211 into master Aug 10, 2020
@@ -36,7 +36,7 @@ def mint_token_request(self, token_req_id, retry=False):
obj = TokenRequest.objects.get(pk=token_req_id)
multiplier = 1
gas_price = int(float(recommend_min_gas_price_to_confirm_in_time(1)) * multiplier)
if gas_price > delay_if_gas_prices_gt_mint:
if gas_price > delay_if_gas_prices_gt_mint and self.request.retries < self.max_retries:
Copy link
Contributor

Choose a reason for hiding this comment

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

wont this LOC do more retries now that you've removed the self.request.retries < self.max_retries condition? now it will infinitely retry, if im reading it right.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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