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

Add retry for each problem #296

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from

Conversation

firewood
Copy link
Contributor

@firewood firewood commented Jun 9, 2024

Why is this change needed?

問題の取得に失敗し、SampleDetectionError が発生することがある。(以前より失敗することが増えた気がする)

What did you implement?

  • Retry により3回リトライするようにした。初回は0.5秒。(リトライに失敗した場合は RetryError が発生する)
  • prepare_contest のほうのリトライは不要になったので削除した。

What behavior do you expect?

  • testに通ること
  • genコマンドの問題の取得の失敗が減ること (0.5秒後に自動リトライして取得に成功すること)
  • 存在しないコンテストを指定してgenを実行すると atcodertools.tools.envgen.EnvironmentInitializationError が発生すること。

@firewood firewood force-pushed the retry_on_4xx_error branch from 622c0e4 to a8445b6 Compare June 9, 2024 13:48
@firewood
Copy link
Contributor Author

firewood commented Jun 9, 2024

fixupまちがえました 🙇

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.25%. Comparing base (30336a7) to head (4ff7041).
Report is 16 commits behind head on stable.

Files Patch % Lines
atcodertools/client/atcoder.py 88.88% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           stable     #296      +/-   ##
==========================================
- Coverage   90.31%   90.25%   -0.07%     
==========================================
  Files          64       64              
  Lines        2788     2781       -7     
==========================================
- Hits         2518     2510       -8     
- Misses        270      271       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyuridenamida
Copy link
Owner

ありがとうございます! コード見る限りよさそうです!もともとのretryはコンテスト開始前にツールを起動した場合の失敗を主に想定していたんですが、ユースケースの区別なくネットワーク通信の深いところで統一的にretryを行うというのには同意です。
挙動に関してはこちらで確認して、よさそうならマージさせていただきます。

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