You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ingestor): bare except Exception reclassifies all pipeline failures as DependencyUnavailable 503 #244
PipelineIngestor.ingest_document() wraps the entire pipeline call in a bare except Exception that re-raises every unrecognised exception as DependencyUnavailable. This hides programming bugs, memory errors, and data-corruption exceptions from operators and callers — making every internal crash look like a transient infrastructure outage.
Root Cause
backend/app/adapters/ingestor.py around line 214–220:
try:
result=awaitanyio.to_thread.run_sync(...)
except (AssertionError, ValueError, TypeError) asexc:
raise# domain errors propagateexceptExceptionasexc:
raiseDependencyUnavailable( # ← ALL other exceptions become 503f"Ingestion pipeline failed: {exc}"
) fromexc
MemoryError, RecursionError, KeyError, RuntimeError, and library-specific exceptions from Qdrant or SQLAlchemy are all silently promoted to "dependency unavailable". The document may be half-written (sections in Postgres, no Qdrant points) with no signal to the caller whether retrying is appropriate.
Failure Scenario
Pipeline raises MemoryError (large PDF, server OOM).
Caller receives 503 Ingestion pipeline failed: ….
Caller retries indefinitely — each attempt OOMs the worker again.
There is no way to distinguish a broken pipeline from an unavailable database using only the HTTP response.
Meanwhile, the document sits in Postgres with ingest_status='pending' and zero sections, permanently invisible in search.
Proposed Fix
except (MemoryError, RecursionError) asexc:
logger.critical("Non-retriable pipeline failure", exc_info=True)
raiseDependencyUnavailable("Pipeline resource exhaustion") fromexcexceptExceptionasexc:
logger.error(
"Unexpected pipeline exception — possible data corruption",
exc_info=True,
extra={"doc_id": doc_id, "tenant_id": tenant_id},
)
raise# propagate as 500, not 503 — caller should NOT retry
Separate retriable infrastructure errors (DB down, Qdrant down) from programming bugs and resource exhaustion so callers can make correct retry decisions.
Activity
piyushmakhija28 commentedon Jun 21, 2026
Fixed in PR #280 (Sprint R3/R4: fix(sprint-r3): root-cause fixes for all 39 bugs from code review round 3 + Sprint R4 round 4)