Skip to content

Fix socket timeouts during connection establishment - #1301

Merged
robsdedude merged 2 commits into
neo4j:6.xfrom
robsdedude:fix/asyncio-0-ssl-timeout
Apr 24, 2026
Merged

robsdedude merged 2 commits into
neo4j:6.xfrom
robsdedude:fix/asyncio-0-ssl-timeout

Conversation

@robsdedude

@robsdedude robsdedude commented Apr 21, 2026 •

Copy link
Copy Markdown
Member
  • Prevent async socket from passing 0 as ssl_handshake_timeout leading to
    a ValueError being raised when the acquisition deadline has expired.
    Raise ServiceUnavailable instead.
  • Align async driver with sync driver:
    • (lazily) raise a ValueError when configured with a negative
      connection_timeout.
    • Treat connection_timeout=0 as "no timeout".
  • Fix sync driver setting the socket timeout to 0 (non-blocking) on expired
    connection_acquisition_timeout.
  • Harden internal code against against None timeouts.

Closes: DRIVERS-331

Amends: #1274

  * Prevent async socket from passing 0 ssl `ssl_handshake_timeout` leading to
    a `ValueError` being raise.
    Raise a `ServiceUnavailable` instead.
  * Align async driver with sync driver:
    * (lazily) raise a `ValueError` when configured with a negative
      `connection_timeout`.
    * Treat `connection_timeout=0` as "no timeout".
  * Fix sync driver setting the socket timeout to `0` (non-blocking) on expired
    `connection_acquisition_timeout`.
  * Harden internal code against against `None` timeouts.
@robsdedude
robsdedude force-pushed the fix/asyncio-0-ssl-timeout branch from 278466e to 0594dd8 Compare April 21, 2026 15:34
@robsdedude
robsdedude marked this pull request as ready for review April 21, 2026 15:35

@RichardIrons-neo4j RichardIrons-neo4j left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job 🍄

@robsdedude
robsdedude merged commit 7bdc3fb into neo4j:6.x Apr 24, 2026
29 checks passed
@robsdedude
robsdedude deleted the fix/asyncio-0-ssl-timeout branch April 24, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants