Skip to content

Conversation search should fail soft on Typesense runtime timeouts #9188

Closed

Description

@Git-on-my-level

Summary

Prod backend conversation search can return a 500 when hosted Typesense times out during search_conversations.

This is low-volume in the sampled window, but the failure mode is a reliability footgun: a transient Typesense read timeout should return a typed degraded result or typed upstream error, not an unhandled traceback.

Evidence

Read-only prod log check on 2026-07-07 UTC found a true Failed to search conversations traceback in the last 2h on old traffic revision backend-01118-phg.

Representative root:

utils/conversations/search.py search_conversations
Typesense hosted endpoint read timeout after 2s
HTTPSConnectionPool(...typesense...): Read timed out (read timeout=2)

Related but not exact coverage: PR #7662 lazily initializes the Typesense client, but does not address runtime request timeouts/fail-open behavior.

Expected behavior

A transient Typesense request timeout should not crash the conversation-search request path.

Acceptance criteria

  • Wrap runtime Typesense request failures in utils/conversations/search.py.
  • Return either:
    • a typed 503/upstream-unavailable response for direct search endpoints, or
    • a degraded empty keyword branch where hybrid search can still proceed with vector results.
  • Log a compact warning/error bucket with endpoint, timeout class, and service name; avoid full tracebacks for expected upstream timeouts.
  • Add regression coverage for a Typesense read timeout.

Activity

  1. added
    bug
    backend
    p3
    on Jul 7, 2026
  2. added a commit that references this issue on Jul 7, 2026
    a77d4a9
  3. added a commit that references this issue on Jul 7, 2026
    3852c86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugp3reliability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions