Repository navigation
fix commoncrawl and waybackarchive source errors - #139
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughThe change limits source connection setup, removes the client-wide HTTP timeout, expands CDX scanner buffers, reports scanner failures, continues Common Crawl index processing after individual errors, and replaces experimental map utilities. ChangesTimeout and source processing
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR improves source error handling, timeout behavior, and CI compatibility without any actionable merge-blocking risk remaining after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation The source reliability changes are in scope. However, replacing experimental map usage in runner statistics and agent construction, plus moving golang.org/x/exp to indirect dependencies, is unrelated cleanup not required by issue Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Closes #133
Two unrelated causes behind the reported errors:
getURLsreturnedfalseon any HTTP error, whichbreaked out of the loop over all 5 yearly indexes. Common Crawl's index frontend intermittently returns 502/504, and since the indexes were iterated from a map (random order), a single bad index would discard the remaining four at random. Now iterates years in order and keeps going past a failed index.http.Client.Timeoutwas set from-timeout(default 30s), which bounds the entire exchange including the response body. Wayback's CDX API regularly needs longer than that just to send headers, and a full response streams for minutes, so it failed withcontext deadline exceeded ... while awaiting headerson essentially any real domain.-timeoutnow applies to connection setup (dial + TLS handshake). The request as a whole is still bounded by-max-time.Also: both sources used
bufio.Scannerat its default 64KB limit and never checkedscanner.Err(), so an over-long CDX line silently truncated results. Added a larger buffer and error reporting. Tagged commoncrawl's error results withType: source.Error. Without itenumerate.gotreated them as URL results and never logged the warning.Before / after on
-d projectdiscovery.io, default flags:Note wayback remains flaky upstream independent of this change. web.archive.org sometimes holds the connection ~4.5 min and then closes it without sending headers (
EOF). That is server-side, so a retry could be a follow-up.CI fixes (unrelated to #133, needed to get this PR green)
lint-testwas already broken ondev. golangci-lintv1.64.8is built with Go 1.24 and refuses a target above that, so it exited during config load:Dependabot raised
go.modtogo 1.25.0in e91a803, butlint-test.ymlskips bot actors, so every dependabot PR since reportedskippingand nothing caught it. This is the first non-bot PR since that bump.projectdiscovery/actions/golangci-lint/v2@v1(golangci-lint v2,golangci-lint-action@v9). v1.64.8 is the final v1 release, so there was no newer v1 to pin.govetinlineonmaps.Copyinpkg/agent/agent.go, caused by the//go:fix inlinedirectives ingolang.org/x/exp/maps. Migratedagent.goandstats.goto the stdlibmapspackage, which drops the deprecated dependency (go mod tidydemotesx/expto indirect). Side benefit: the "Selected source(s)" debug line and the stats table are now deterministically ordered.Summary by CodeRabbit