Adding a configuration for max retries to handle system wide outages
まだ誰も着手していません。
評価
調査の方向性
algoliasearch-core/src/main/java/com/algolia/search/HttpTransport.java、特に executeWithRetry から始め、次に RetryStrategy.java と ConfigBase を読んで、タイムアウトとリトライ回数の処理を追跡します。タイムアウトしたリクエスト中の動作を確認し、ホストごとに設定可能なリトライ上限によってリトライが無制限に増え続けるのを止め、未設定時には既存のリトライ動作を維持できれば完了とします。
索引モデルが issue の本文から書いたものです。
説明
- Algolia Client Version: 3.16.6
- Language Version: Java
Description
Correct me if I am mistaken but HttpTransport.executeWithRetry will before sending a request, increase the timeout for the request based on the number of retries. After the response is received, it uses RetryStrategy to determine what to do with the results.
The function RetryStrategy.decide will in the case of a request time out, will always retry.
During an Indexer service outage in July 13th, it appears that was happening for the entire length of the outage causing the Promises to hang and never fail. This becomes a pretty big issue when using BatchIndexingResponse.waitTask() like in the API examples.
Proposed change
- Adding a new configurable property to ConfigBase called something along the lines of
maxRetriesPerHostand updateRetryStrategyto save that value in its constructor. - Update
RetryStrategy.decideto something along the lines of
} else if (response.isTimedOut()) {
boolean shouldKeepUp = maxRetriesPerHost == null || tryableHost.getRetryCount() <= maxRetriesPerHost;
tryableHost.setUp(shouldKeepUp);
tryableHost.setLastUse(AlgoliaUtils.nowUTC());
tryableHost.incrementRetryCount();
return RetryOutcome.RETRY;
}
Why make the change
During the time of the indexing outage, it was not clear immediately why our requests were stuck. Looking at the code it seems like if the servers actually responded with server errors, the StatefulHosts would have been turned off one by one which would be closer to what I would expect from an outage. The current logic has no way of determining this type of issue, causing ever expanding timeouts without any way of intervening.
- 主要言語
- Java
- スター
- 51
- フォーク
- 33
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
algolia/algoliasearch-client-java のほかの issue
-
Upgrade to Jackson 3オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
algolia/algoliasearch-client-java#788 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
algolia/algoliasearch-client-java#781 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
Enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
algolia/algoliasearch-client-java の issue をすべて見る
似ている issue
-
bug pdd
難易度 2/5 1時間未満 初心者へのやさしさ 76/100
objectionary/eoc#1555 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ClouGence/open-cdm#487 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
security
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信