Skip to content

Conversation

injectives
Copy link
Contributor

@injectives injectives commented Sep 11, 2025

This update adds experimental support for TCP Fast Open.

A working TCP Fast Open setup enables the driver to start one of the following during TCP handshake by sending early data:

  • Bolt Handshake (for connections not needing encryption)
  • TLS Handshake (for connections needing encryption)

The TCP Fast Open is only supported when all of the following is true:

  • The system the driver is running on supports and has TCP Fast Open enabled.
  • One of the following connection URI schemes is used:
    • neo4j
    • neo4j+s
    • neo4j+ssc
    • bolt
    • bolt+s
    • bolt+ssc
  • One of the following Netty Native Transports that is compatible with the system the driver is running on is added to the runtime by the user:
  • netty-transport-native-io_uring (Netty 4.2+ only)
  • netty-transport-native-epoll
  • netty-transport-native-kqueue

Even when all of the above is true, it is important to make sure that the endpoint the driver connects to also supports and has TCP Fast Open enabled. Otherwise, an extra slight overhead is likely and end-to-end TCP Fast Open benefits will not be available.

At present, this is an opt-in Config option available via ConfigBuilder#withTcpFastOpenEnabled(boolean). It is false by default.

@injectives injectives force-pushed the feature/tfo branch 3 times, most recently from 18ed19e to 470215a Compare September 11, 2025 12:47
Copy link

@MaxAake MaxAake left a comment

Choose a reason for hiding this comment

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

✍🏻 ❓

@injectives injectives force-pushed the feature/tfo branch 2 times, most recently from 3fd9e09 to 28cacfe Compare September 11, 2025 15:37
This update adds experimental support for TCP Fast Open.

A working TCP Fast Open setup enables the driver to start one of the following during TCP handshake by sending early data:
- Bolt Handshake (for connections not needing encryption)
- TLS Handshake (for connections needing encryption)

The TCP Fast Open is only supported when all of the following is true:
- The system the driver is running on supports and has TCP Fast Open enabled.
- One of the following connection URI schemes is used:
  - neo4j
  - neo4j+s
  - neo4j+ssc
  - bolt
  - bolt+s
  - bolt+ssc
- One of the following Netty Native Transports that is compatible with the system the driver is running on is added to the runtime by the user:
 - netty-transport-native-io_uring (Netty 4.2+ only)
 - netty-transport-native-epoll
 - netty-transport-native-kqueue

Even when all of the above is true, it is important to make sure that the endpoint the driver connects to also supports and has TCP Fast Open enabled. Otherwise, an extra slight overhead is likely and end-to-end TCP Fast Open benefits will not be available.

At present, this is an opt-in `Config` option available via `ConfigBuilder#withTcpFastOpenEnabled(boolean)`. It is `false` by default.
@injectives injectives changed the title feat(tfo): add support for TFO feat(tfo): add experimental support for TFO Sep 11, 2025
Copy link

@MaxAake MaxAake left a comment

Choose a reason for hiding this comment

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

@injectives injectives merged commit b2b7507 into neo4j:6.x Sep 12, 2025
23 of 24 checks passed
@injectives injectives deleted the feature/tfo branch September 12, 2025 08:31
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