fix(lib): netio TCP connections run with TCP_NODELAY (bug-1890)

With Nagle on, the small TLS record that ends a burst -- a packet header,
the last short chunk of an HA snapshot, a reply -- waited for the peer's
delayed ACK, ~40 ms on Linux: seen on 5 of 40 snapshot transfers. Set
TCP_NODELAY on every netio TCP socket, outbound (socket_create) and
accepted (socket_accept).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-29 14:38:57 +00:00
parent 3061df1401
commit 8b561547dd
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 119 additions and 0 deletions

View file

@ -50,6 +50,7 @@ extern void test_netio_close_propagation(void);
extern void test_netio_bounded_connect(void);
extern void test_netio_batch_dispatch_uaf(void);
extern void test_netio_err_queue(void);
extern void test_netio_nodelay(void);
extern void test_request_send_propagation(void);
extern void test_raft(void);
extern void test_wal_wire(void);
@ -178,6 +179,7 @@ int main(int argc, char* argv[])
TEST(test_netio_bounded_connect);
TEST(test_netio_batch_dispatch_uaf);
TEST(test_netio_err_queue);
TEST(test_netio_nodelay);
TEST(test_request_send_propagation);
TEST(test_raft);
TEST(test_wal_wire);