feat: support server-side keep-alive for mysql and pg protocols (#5496)

* feat: support server-side keep-alive for mysql and pg protocols

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update config.md

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update config to use humantime for keep-alive configuration

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* chore: Update socket2 dependency

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2025-02-11 11:22:10 -08:00
committed by GitHub
parent beb9c0a797
commit e22aa819be
15 changed files with 70 additions and 3 deletions

View File

@@ -589,6 +589,7 @@ pub async fn setup_mysql_server_with_user_provider(
ReloadableTlsServerConfig::try_new(opts.tls.clone())
.expect("Failed to load certificates and keys"),
),
0,
opts.reject_no_database.unwrap_or(false),
)),
));
@@ -641,6 +642,7 @@ pub async fn setup_pg_server_with_user_provider(
ServerSqlQueryHandlerAdapter::arc(fe_instance_ref),
opts.tls.should_force_tls(),
tls_server_config,
0,
runtime,
user_provider,
)) as Box<dyn Server>);

View File

@@ -923,6 +923,7 @@ watch = false
enable = true
addr = "127.0.0.1:4002"
runtime_size = 2
keep_alive = "0s"
[mysql.tls]
mode = "disable"
@@ -934,6 +935,7 @@ watch = false
enable = true
addr = "127.0.0.1:4003"
runtime_size = 2
keep_alive = "0s"
[postgres.tls]
mode = "disable"