algolia / algolia/algoliasearch-client-python
feat: Edit the requests configuration pool_maxsize variable when initializing client
- 主要言語
- Python
- スター
- 207
- フォーク
- 63
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
- Algolia Client Version: 2.4.0
- Language Version: Python 3.9.1
### Description
I'm replicating a dataset (60k records) with 100 threads (Python's builtin _ThreadExecutor_) at a time. And I find that from time to time I keep getting these warnings from the 'requests' library: **"Connection pool is full, discarding connection: xxxxxxxx.algolia.net"**.
The ability to edit the _pool_maxsize_ configuration variable when initializing the search client would solve this kind of issues, perhaps even allowing to edit other _requests_ configurations.
### Steps To Reproduce
Initialize a ThreadExecutor of 100 max workers.
Create a function that uses 'save_object' to store a record in a predefined index.
Loop through thousands of records, for each record:
-Add the function that saves the record with the record data to the executor
You should get the warning every ~1000 records.
コントリビューションガイド
調査の方向性
検索クライアントの初期化パスから開始し、その requests セッションまたは接続プールがどのように設定されているかを追跡します。並行する save_object 呼び出しがその設定をどのように使用するかを確認します。完了の条件は、呼び出し側がクライアント作成時に pool_maxsize を設定でき、100 ワーカーの再現でプールが一杯であることを示す警告が出なくなることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100