Bound the total number of Solr queries the API has in flight across concurrent requests
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- api, backend, performance
調査の方向性
Start with api/server.py and Config.solr_max_concurrent_lookups, then review the shared httpx client and connection limits introduced by #310. Use the Solr capacity benchmark in TranslatorSRI/babel-validation#107 and the timing work in #309 to guide decisions about the process-wide limit, fairness, and overload behavior. Done means Solr concurrency is bounded across endpoints and concurrent requests, with queueing or rejection behavior and its timeout outcomes covered.
索引モデルが issue の本文から書いたものです。
説明
Nothing bounds how many Solr queries the NameRes API process has in flight in total.
SOLR_MAX_CONCURRENT_LOOKUPS(default 100) is a semaphore per/bulk-lookuprequest (Config.solr_max_concurrent_lookupsinapi/server.py). Its comment notes that the service-wide total is that limit multiplied by the number of bulk requests being served at once, and that the default of 100 "should be revisited once we know the real request rate", pointing at TranslatorSRI/babel-validation#107./lookup,/synonymsand the rest have no limit at all.- #310 replaces the per-query httpx clients with one shared client per event loop. It deliberately leaves that client's pool uncapped (
httpx.Limits(max_connections=None, ...)) to keep today's behaviour. A cap below what/bulk-lookupcan have in flight would make queries wait for a pool slot insideSOLR_TIMEOUT_SECONDS, so a busy pool would show up as Solr timeouts.
So a few concurrent large bulk requests, or a burst of autocomplete traffic, can put hundreds of queries on Solr at once. #306 (six concurrent lookups for "vitamin a", each blocked on Solr for 4-5 minutes) may be this or something else, but nothing in the API stops a pile-up like it.
Questions to settle:
- Where the bound lives. A process-wide semaphore around every Solr request, a capped httpx pool, or both. With a capped pool, the wait for a connection needs its own timeout (httpx's
pooltimeout), separate from Solr's, so thatrecent_queriescan tell "NameRes queued it" apart from "Solr was slow". That probably means another outcome alongsidetimeouts. - Fairness. Whether one
/bulk-lookupcan take every slot, starving/lookup(interactive autocomplete), or whether bulk gets a share. - The number. It should come from Solr's capacity under the measured request mix (babel-validation#107's benchmark), not a guess. It also needs dividing by the number of API replicas, since each replica has its own limit.
- What callers see when it's full: queueing, or a fast 503 with
Retry-After.
Related: #309 (timing /bulk-lookup, which would show how long bulk strings wait for a slot).
- 主要言語
- Python
- スター
- 5
- フォーク
- 4
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NCATSTranslator/NameResolution のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NCATSTranslator/NameResolution の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.py対応中かも @prabhleen2317 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/iceberg-python#4387 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yaml対応中かも @Parth-Vasave が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/apm#3749 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/numba-cuda-mlir#467 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信