algolia / algolia/algoliasearch-client-python

Update AlgoliaUnreachableHostException to OperationTimeout

オープン
#556 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
207
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

説明

- Algolia Client Version: 2.5.0 (I see that 3.0 was released 3 days ago, not sure if that resolves this)
- Language Version: Python 3.9.7

### Description

Client throws `algoliasearch.exceptions.AlgoliaUnreachableHostException`: Unreachable hosts during `replace_all_objects` operation. The issue was not that hosts were unreachable but that the operation was timing out. I fixed the problem by setting `readTimeout` to 100:

```
client = SearchClient.create(algolia_application_id, algolia_api_key)
index = client.init_index(algolia_index)
request_options = {
"readTimeout": 100
}
index.replace_all_objects(records, request_options)
```

A timeout should produce a timeout error. Unreachable is misleading.

### Steps To Reproduce

See description.
Use `replace_all_objects` on a sufficiently big index. Mine was 6393 rows and 10+ columns some with significant text blocks.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、Python クライアントにおける replace_all_objects のタイムアウト処理を追跡し、失敗が AlgoliaUnreachableHostException にどのようにマッピングされるかを確認します。十分に大きなインデックスで操作を再現し、その後、読み取りタイムアウトでは OperationTimeout が報告され、実際に到達不能なホストでは引き続きホスト例外が報告されることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。