snipe/api
pyr0ball e539427bec fix: catch sqlite3.OperationalError in search post-processing
Under high concurrency (100+ users), shared_db write contention causes
database is locked errors in the unguarded post-scrape block. These were
surfacing as 500s because there was no exception handler after line 663.

Now catches OperationalError and returns raw listings with empty trust
scores/sellers (degraded mode) instead of crashing. The SSE queue entry
is cleaned up on this path so no orphaned queue accumulates.

Root cause: shared_db (sellers, market_comps) is SQLite; at 100 concurrent
writers the WAL write queue exceeds the 30s busy timeout. Long-term fix
is migrating shared state to Postgres (see snipe#NN).

Refs: infra#12 load test Phase 2 spike findings
2026-04-19 21:26:20 -07:00
..
__init__.py feat(snipe): FastAPI layer, Playwright+Xvfb scraper, caching, tests 2026-03-25 20:09:30 -07:00
cloud_session.py feat: add llm_query_builder tier gate (paid+) to tiers.py and SessionFeatures 2026-04-14 11:44:53 -07:00
ebay_webhook.py fix: authenticate eBay public key fetch + add webhook health endpoint 2026-04-18 22:20:29 -07:00
main.py fix: catch sqlite3.OperationalError in search post-processing 2026-04-19 21:26:20 -07:00