2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

boto3:retryのアルゴリズム実装memo

Posted at

botocore/botocore/retryhandler.py

boto3の指数バックオフ + jitterは以下の式
base * growth_factor ^ (attempts - 1)

  • baseはrand()なので、0-1の間。リトライ実行ごとにシャッフルされる
  • DynamoDBだけbaseが0.05固定 botocore/botocore/data/_retry.jsonより
  • growth_factorは初期値2

リトライ初回はattempts=1よりbaseとなり、一瞬待つことになる。
rand()が0に近いとほぼ待たずにリトライすることがある。

実装の疑問
https://github.com/boto/botocore/issues/1471

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?