Skip to content

error_all_requests hides original exception details #707

@dkropachev

Description

@dkropachev

error_all_requests() at connection.py:1035 always wraps the error:

new_exc = ConnectionShutdown(str(exc))

This means whether the connection failed due to:

  • Expected closure: driver shutting down, graceful server disconnect
  • Unexpected I/O failure: ECONNRESET, EPIPE, EBADF mid-operation

...pending requests always receive ConnectionShutdown. The retry policy and Session._handle_error cannot distinguish between these cases.

This matters because:

  • Expected closures are safe to retry immediately on another host
  • Unexpected failures might indicate a problematic node (worth logging warnings, backing off)

Possible fix direction: Preserve the original exception through error_all_requests(), or introduce error subclasses that carry both the shutdown signal and the underlying cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions