webclaw/crates/webclaw-fetch/src
Valerio 8a0a6fd8ce fix(fetch): surface semaphore-closed as typed error instead of panic (P1)
Three call sites in webclaw-fetch used .expect("semaphore closed") on
`Semaphore::acquire()`. Under normal operation they never fire, but
under a shutdown race or adversarial runtime state the spawned task
would panic and be silently dropped from the batch / crawl run — the
caller would see fewer results than URLs with no indication why.

Rewritten to match on the acquire result:
- client::fetch_batch and client::fetch_and_extract_batch_with_options
  now emit BatchResult/BatchExtractResult carrying
  FetchError::Build("semaphore closed before acquire").
- crawler's inner loop emits a failed PageResult with the same error
  string instead of panicking.

Behaviorally a no-op for the happy path. Fixes the silent-dropped-task
class of bug noted in the 2026-04-16 audit.

Version: 0.3.14 -> 0.3.15
CHANGELOG updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 19:14:00 +02:00
..
browser.rs fix: clippy empty-line-after-doc-comment in browser.rs 2026-03-29 16:45:05 +02:00
client.rs fix(fetch): surface semaphore-closed as typed error instead of panic (P1) 2026-04-16 19:14:00 +02:00
crawler.rs fix(fetch): surface semaphore-closed as typed error instead of panic (P1) 2026-04-16 19:14:00 +02:00
document.rs feat: replace custom TLS stack with wreq (BoringSSL), bump v0.3.3 2026-04-01 18:04:55 +02:00
error.rs feat: replace custom TLS stack with wreq (BoringSSL), bump v0.3.3 2026-04-01 18:04:55 +02:00
lib.rs style: cargo fmt 2026-04-01 18:25:40 +02:00
linkedin.rs Initial release: webclaw v0.1.0 — web content extraction for LLMs 2026-03-23 18:31:11 +01:00
proxy.rs Initial release: webclaw v0.1.0 — web content extraction for LLMs 2026-03-23 18:31:11 +01:00
reddit.rs Initial release: webclaw v0.1.0 — web content extraction for LLMs 2026-03-23 18:31:11 +01:00
sitemap.rs feat: add fallback sitemap paths for broader discovery 2026-04-10 18:22:57 +02:00
tls.rs feat: replace custom TLS stack with wreq (BoringSSL), bump v0.3.3 2026-04-01 18:04:55 +02:00