Skip to content

Isolate scraper panics, warm goment tables, guard Grooby dates - #2280

Open
moToroTor wants to merge 1 commit into
xbapps:masterfrom
moToroTor:fix/2279-scraper-panic
Open

moToroTor wants to merge 1 commit into
xbapps:masterfrom
moToroTor:fix/2279-scraper-panic

Conversation

@moToroTor

Copy link
Copy Markdown

Fixes #2279.

Running all scrapers, the whole server died with SIGSEGV inside goment (parse.go:403, via pkg/scrape/transvr.go:64). Root cause is a data race, not a bad date string: goment.New fills its global parse/format tables lazily with no mutex or sync.Once, so the first burst of concurrent scraper goroutines collides reader-against-writer and can call a nil function value. I confirmed it both ways — 4,172 malformed inputs through the exact call never panic, while 64 goroutines under -race trip the detector immediately. Single-scraper runs survive because the tables finish building before concurrency starts.

Changes:

  • New pkg/scrape/date_parse.go: package init warms both goment tables once, single-threaded, before any goroutine runs. After that they are read-only, so this covers all 30+ goment.New call sites process-wide.
  • Same file: parseGroobyDate() only forwards Month D, YYYY-shaped strings to goment and returns "" otherwise; wired into transvr.go and groobyvr.go (identical code, identical latent crash).
  • pkg/tasks/content.go: new runScraperSafe() wraps both scraper spawn sites with recover() — one bad site logs scraper X panicked and was skipped and the run continues. wg.Done stays deferred inside each scraper, so batch accounting is unaffected.

Tests: pkg/scrape/date_parse_test.go (valid dates format, garbage yields "") and pkg/tasks/scrape_safe_test.go (panicking fake scraper is contained, counter returns to zero). Both suites green; full go build ./... clean.

…bapps#2279)

goment fills its global parse/format tables lazily with no sync, so the
first burst of concurrent scrapers races reader against writer and can
call a nil func value -> SIGSEGV, killing the whole server (TransVR date
parse). Warm both tables once in scrape init; parse Grooby-network dates
through a shape-checked helper returning "" on garbage (transvr,
groobyvr); wrap both runScrapers spawn sites in recover() so one bad
site logs-and-skips instead of taking down the run.

Assisted-By: muse-spark-1.3
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.

TransVR scraper panic on release-date parse kills the whole server

1 participant