Repository navigation
fix: ask the head poll for 100 comments and log only long empty streaks - #102
Merged
Merged
Conversation
Co-Authored-By: Toldry <toldry@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ddUNNyEKK7YQuAyfKfGwi
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.
Requested by Querent · project thread
Before: on 3.1.1 the VM logged
The r/all comment listing returned no comments(WARNING) and... has comments again after N empty poll(s)(INFO) about every 30 seconds. Reddit was returning an empty r/all listing on roughly every other head poll withlimit=25. Nothing was lost, since the next poll queues every block up to the head, but the log was flooded.After: the head poll asks for 100 comments, the most one request can return. Reddit filters the listing after applying the limit, so a bigger limit should make empty pages rarer. Empty polls are counted in the heartbeat (
head: 50 polls (12 empty), 1.70 s/poll). A WARNING is logged only afterEMPTY_HEAD_POLLS_BEFORE_WARNING(6) empty polls in a row, which is about a minute without new blocks being queued. A matching INFO line is logged when such a streak ends.How:
HEAD_LISTING_LIMITgoes from 25 to 100.CommentReader.poll_headlogs only at the streak threshold, andStreamMetrics.record_head_poll(seconds, empty=False)counts empty polls. This adds unit tests and updates AGENTS.md and a changelog fragment.Generated by Claude Code