Skip to content

Commit da786ea

Browse files
authored
chore!: Bind to IPv4 only (#91)
* chore!: Bind to IPv4 only * changelog
1 parent 8f09fb2 commit da786ea

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
99
- The Stackable scaler now ensures that a `TrinoCluster` has changed to `ready` more than 5 seconds
1010
ago before marking it as `ready` ([#68]).
1111
- Emit less attributes in tracing to make logs easier readable ([#86]).
12+
- BREAKING: Only bind to IPv4 (`0.0.0.0`) instead of IPv6 (`::`).
13+
On most Linux systems, binding to `::` dual-stacks, on Windows this would likely bind to IPv6 only.
14+
As a user reported that they run into `Address family not supported by protocol (os error 97)`, we now only bind to IPv4.
15+
There was some attempt to make it portable work on IPv4 and IPv6 (optional), but that turned out to be a bigger story for later ([#91]).
1216

1317
### Fixed
1418

@@ -17,6 +21,7 @@ All notable changes to this project will be documented in this file.
1721
[#68]: https://github.com/stackabletech/trino-lb/pull/68
1822
[#85]: https://github.com/stackabletech/trino-lb/pull/85
1923
[#86]: https://github.com/stackabletech/trino-lb/pull/86
24+
[#91]: https://github.com/stackabletech/trino-lb/pull/91
2025

2126
## [0.5.0] - 2025-03-14
2227

trino-lb/src/http_server/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{
22
fmt::Debug,
3-
net::{Ipv6Addr, SocketAddr},
3+
net::{Ipv4Addr, SocketAddr},
44
path::PathBuf,
55
sync::Arc,
66
time::Duration,
@@ -77,7 +77,7 @@ pub async fn start_http_server(
7777
.route("/", get(|| async { Redirect::permanent("/metrics") }))
7878
.route("/metrics", get(metrics::get))
7979
.with_state(Arc::clone(&app_state));
80-
let listen_addr = SocketAddr::from((Ipv6Addr::UNSPECIFIED, ports_config.metrics));
80+
let listen_addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, ports_config.metrics));
8181
info!(%listen_addr, "Starting metrics exporter");
8282

8383
let handle = Handle::new();
@@ -129,7 +129,7 @@ pub async fn start_http_server(
129129

130130
if tls_config.enabled {
131131
// Start https server
132-
let listen_addr = SocketAddr::from((Ipv6Addr::UNSPECIFIED, ports_config.https));
132+
let listen_addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, ports_config.https));
133133
info!(%listen_addr, "Starting server");
134134

135135
let cert_pem_file = tls_config.cert_pem_file.context(CertsMissingSnafu)?;
@@ -148,7 +148,7 @@ pub async fn start_http_server(
148148
.context(StartHttpServerSnafu)?;
149149
} else {
150150
// Start http server
151-
let listen_addr = SocketAddr::from((Ipv6Addr::UNSPECIFIED, ports_config.http));
151+
let listen_addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, ports_config.http));
152152
info!(%listen_addr, "Starting server");
153153

154154
axum_server::bind(listen_addr)

0 commit comments

Comments
 (0)