LoginSignup
0
0

More than 3 years have passed since last update.

Rubyのgrpcコールのretry戦略

Posted at

最近忙しいのでメモるだけ。

DeadlineExceeded(4)はretryしたい

  • サーバー側が混んでいるのなら、exponential backoffするべきだし、
  • (patameterに指定したレコードが多すぎて)サーバ側の計算量が多くて遅くなっているのなら、2回目のリクエストは、1回めより、deadlineを長くてやる必要がある気がする。

    resp =
      Retryable.retryable(tries: 3, on: [GRPC::DeadlineExceeded]) do
        GrpcCallingService.new.call(user_id: 111)
      end

0
0
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
0
0