Skip to content

Second chance for flaky follow-ups, 10 s timeout in the hourly run - #393

Merged
maximilianfeix merged 4 commits into
mainfrom
feat/second-chance
Nov 12, 2026
Merged

maximilianfeix merged 4 commits into
mainfrom
feat/second-chance

Conversation

@maximilianfeix

Copy link
Copy Markdown
Owner

Why

Only ~770 of ~1,100 working proxies made the hourly list. Per run, about 350 confirms and 280 content checks ended in connect_timeout / timeout / connection_closed / no_answer right after the proxy had passed its basic check (and after the retry 1.5 s later). The hourly list requires passed for basic, confirm and content, so those proxies were lost. Another ~10,000 candidates per run connected but answered after the 6 s limit.

What changes

  • pipeline.run_checks: the follow-ups (confirm, content, details) now live in follow_up(). If a follow-up breaks off in transport (checker.RETRY_REASONS), nothing is recorded yet. At the end of the run, at least SECOND_CHANCE_DELAY (20 s) after that try, the proxy gets both requests once more and counts as whatever they end as, once per check. run.json reports the outcomes as checks.second_chance. Proxies still waiting when the run is stopped end as unconfirmed, so the basic counts stay complete.
  • proxy-list.yml: --timeout 10 instead of 6. The connect stays at 4 s.
  • Docs (docs/check-states.md), CHANGELOG, and the workflow test.

Measured (A/B on GitHub runners started at the same time, 150,000 candidates each, 12 Nov)

Arm Listed (basic+confirm+content passed)
main 768
second chance 986 / 979
second chance + --timeout 10 1,177

A second round had all arms with the second chance:

Arm Working
10 s 1,379
15 s 1,464 (+6 %, slower list, not taken)
10 s + 6 new self-checking sources 1,382 (their proxies are already in our pool, so not added)

The check phase takes 5–6 minutes instead of 3–5.

Ruled out:

  • Removing the 150k limit gave 1,111 instead of 1,095.
  • Checking all ~231k addresses of the 45.74.31.40–47 gateway gave 537 instead of 323.

The run-to-run swings (2,000–2,500 vs ~1,000) follow that gateway's state.

Tests

Two new tests in tests/test_pipeline.py: recovery, a real verdict not retried, content unavailable twice, and a second chance that fails counting once. Both fail without the change. Full suite: 1540 passed.

A proxy whose confirm or content request ended in connect_timeout, timeout,
connection_closed or no_answer right after a passed basic check gets both
follow-ups once more at the end of the run, at least 20 s later. Each proxy
is counted once per check, as its last try ended; run.json reports how the
second tries ended under checks.second_chance.
A/B on 12 Nov: 768 -> 986 listed proxies with the second chance, 1,177
with both.
…phase 2

- the deferred entry leaves the list when its verdict is recorded, not after
  the HTTPS test: --want reached during another proxy's enrich counted that
  proxy as working and unconfirmed
- a check target switch during the second chances requeued basic checks that
  no worker took anymore: workers run again until queue and deferred are empty
- checks.second_chance only appears once a second chance ended
@maximilianfeix

Copy link
Copy Markdown
Owner Author

Fixed both review findings in the last commit:

  • A proxy stopped during its second chance is now counted once. Its deferred entry is removed as soon as its verdict is recorded, not only after the HTTPS test. Regression test: test_goal_reached_during_second_chance_counts_every_proxy_once.
  • A check-target switch during the second-chance phase now gets its basic checks rechecked. run_checks runs workers again until both the retry queue and deferred are empty. Test: test_switch_during_the_second_chances_still_rechecks.

Both tests fail without the fix. Full suite: 1542 passed.

@maximilianfeix
maximilianfeix merged commit 2039330 into main Nov 12, 2026
23 checks passed
@maximilianfeix
maximilianfeix deleted the feat/second-chance branch November 12, 2026 08:12
@maximilianfeix maximilianfeix mentioned this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant