fix(poller): lower pollComments cap from 30 to 10 to fit Worker subrequest budget#144
Merged
liplus-lin-lay merged 1 commit intoApr 28, 2026
Conversation
…quest budget (#134) PR #136 で導入した cap=30 でも本番環境で `Too many subrequests` が解消しないことを観測したため、`src/poller.ts` の `MAX_COMMENT_FETCHES_PER_REPO_PER_RUN` を 30 から 10 に引き下げる。1 fetch あたり Vectorize embed + D1 FTS upsert + Workers AI + Store DO 呼び出しなどの multi-subrequest overhead が乗るため、5 repos × 30 fetches × ~3-5 subrequests で 1000 budget を使い切っていた。 2026-04-28T15:15 UTC の :15 cron (再デプロイから約 33 分後) で 5 repos すべてが `fetches_issued=30/30, fetch_failures=30, Too many subrequests` を記録した観測に基づく。 cap=10 にすることで worst-case 5 × 10 = 50 fetches × ~5 subrequests ≈ 250 に収まり、parent overhead や他 poller の余地を残しつつ 1000 制限に十分収まる。 Refs #134
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
github-rag-mcp | b26718b | Apr 28 2026, 03:30 PM |
liplus-lin-lay
commented
Apr 28, 2026
Member
Author
liplus-lin-lay
left a comment
There was a problem hiding this comment.
Self-review (auto mode)
観測根拠の妥当性
2026-04-28T15:15 UTC の :15 cron で 5 repos 全てが fetches_issued=30/30, fetch_failures=30, Too many subrequests を記録した観測は、cap=30 が 1000-subrequest budget に対して過大であることの直接証拠。pollComments: fetch budget reached warn 発火と Too many subrequests 同時発生は、cap が機能していても fetch 時点で既に budget が枯渇している状態を示す。
cap=10 の overhead 計算
- worst-case: 5 repos × 10 fetches = 50 fetches
- 1 fetch あたり ~3-5 subrequests (Vectorize embed + D1 FTS upsert + Workers AI + Store DO)
- 50 × 5 = 250 subrequests + per-parent overhead + diff/wiki/issue poller の余地
- 1000 budget に対して headroom 750+ あり、十分な余裕
Regression risk
- 4 working repos は元々 issue 数が少なく cap に到達していなかった (
fetches_issued < 30)。cap=10 でも実数値が 10 未満であれば挙動不変。 - dipper_ai のみ高 issue 数で cap が制約だったが、cap=30 でも budget exhaust していたのだから、cap=10 で fetch 数が減ることは前進方向の変更。
- 残り parent は次 cron で拾う設計が元から入っているので、見落としは発生しない。
検証経路
- merge → CD → 再デプロイ (Cloudflare Workers)
- 次の :15 cron 1-2 周で
fetch_failures=0または大幅減を確認 - 確認後、issue #134 を close
判断
LGTM. Self-approve 相当 (auto mode は formal approve なし、self-review コメントで gate 通過)。
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
src/poller.tsのMAX_COMMENT_FETCHES_PER_REPO_PER_RUNを 30 から 10 に引き下げる。PR #136 で 30 を導入した直後の本番観測で、cap=30 でもToo many subrequestsが解消していないことを確認したため。観測根拠
2026-04-28T15:15 UTC の
:15pollComments cron (再デプロイから約 33 分後):fetches_issued=30/30, fetch_failures=30, Too many subrequestspollComments: fetch budget reachedは発火しているが、cap=30 に到達する前に Worker の 1000-subrequest-per-invocation budget を使い切っている数値根拠
注意
Refs留めで OPEN を維持し、merge 後:15cron 1-2 周でfetch_failures=0を確認してから close する。Refs #134