Skip to content

Commit 959101d

Browse files
authored
fix(trino): Backport airlift/airlift#1943 for max response header size (#1510)
* fix(trino): Backport airlift/airlift#1943 for max response header size * chore: changelog * fix: add 1GB limit * chore: add airlift version comment / fix mail address
1 parent c2a6f72 commit 959101d

10 files changed

Lines changed: 136 additions & 0 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
2323
- opensearch: Scope CycloneDX SBOM to shipped components only, eliminating false positive CVEs from unshipped plugins ([#1452]).
2424
- vector: Look for SBOM in correct location ([#1471]).
2525
- vector: Use correct license ([#1476]).
26+
- trino: Build a patched Airlift from source and depend on it to backport [airlift/airlift#1943](https://github.com/airlift/airlift/pull/1943), applying the configured max response header size to Jetty's `maxResponseHeaderSize` ([#1510]).
2627

2728
### Removed
2829

@@ -40,6 +41,7 @@ All notable changes to this project will be documented in this file.
4041
[#1481]: https://github.com/stackabletech/docker-images/pull/1481
4142
[#1493]: https://github.com/stackabletech/docker-images/pull/1493
4243
[#1509]: https://github.com/stackabletech/docker-images/pull/1509
44+
[#1510]: https://github.com/stackabletech/docker-images/pull/1510
4345

4446
## [26.3.0] - 2026-03-16
4547

trino/airlift/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
2+
# check=error=true
3+
4+
# We use a custom patched airlift version to fast track https://github.com/airlift/airlift/pull/1943
5+
# This can be removed once the PR is merged and Trino makes use of the new Airlift version containing the fix
6+
7+
FROM local-image/java-devel AS airlift-builder
8+
9+
ARG PRODUCT_VERSION
10+
ARG RELEASE_VERSION
11+
ARG STACKABLE_USER_UID
12+
13+
WORKDIR /stackable
14+
15+
COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/patchable.toml /stackable/src/trino/airlift/stackable/patches/patchable.toml
16+
COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/airlift/stackable/patches/${PRODUCT_VERSION}
17+
18+
# hadolint ignore=SC2215
19+
RUN --mount=type=cache,id=maven-airlift-${PRODUCT_VERSION},target=/root/.m2/repository <<EOF
20+
cd "$(/stackable/patchable --images-repo-root=src checkout trino/airlift ${PRODUCT_VERSION})"
21+
22+
NEW_VERSION="${PRODUCT_VERSION}-stackable${RELEASE_VERSION}"
23+
24+
mvn versions:set -DnewVersion=$NEW_VERSION -DartifactId='*' -DgroupId='*' -DgenerateBackupPoms=false
25+
26+
mvn \
27+
install \
28+
-DskipTests \
29+
-Dair.check.skip-all \
30+
-Dcheckstyle.skip \
31+
-Dmaven.javadoc.skip=true \
32+
-Dmaven.gitcommitid.skip=true \
33+
--projects='!sample-server,!skeleton-server'
34+
35+
mkdir -p /stackable/patched-libs/maven/io
36+
cp -r /root/.m2/repository/io/airlift /stackable/patched-libs/maven/io
37+
38+
chmod --recursive g=u /stackable/patched-libs
39+
EOF

trino/airlift/boil-config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[versions."361".local-images]
2+
java-devel = "24"
3+
4+
[versions."386".local-images]
5+
java-devel = "25"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 846dafacf01735c4eb507959f7b9456d8fe8ebdc Mon Sep 17 00:00:00 2001
2+
From: Lukas Krug <lukas.krug@stackable.tech>
3+
Date: Wed, 27 May 2026 21:58:48 +0200
4+
Subject: Apply max response header size to Jetty maxResponseHeaderSize
5+
6+
---
7+
.../src/main/java/io/airlift/http/server/HttpServer.java | 2 +-
8+
.../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 +
9+
2 files changed, 2 insertions(+), 1 deletion(-)
10+
11+
diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServer.java b/http-server/src/main/java/io/airlift/http/server/HttpServer.java
12+
index 6da8193ebe..5a8f4009bf 100644
13+
--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java
14+
+++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java
15+
@@ -193,7 +193,7 @@ public class HttpServer
16+
baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes()));
17+
}
18+
if (config.getMaxResponseHeaderSize() != null) {
19+
- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes()));
20+
+ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes()));
21+
}
22+
if (config.getOutputBufferSize() != null) {
23+
baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes()));
24+
diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
25+
index c4ebbdf9d3..760f72347a 100644
26+
--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
27+
+++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
28+
@@ -372,6 +372,7 @@ public class HttpServerConfig
29+
return this;
30+
}
31+
32+
+ @MaxDataSize("1GB")
33+
public DataSize getMaxResponseHeaderSize()
34+
{
35+
return maxResponseHeaderSize;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mirror = "https://github.com/stackabletech/airlift.git"
2+
base = "69314d3f2d3a72533704b8ef08d68b23875c5513"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 359fe4dbf5154df20701cea742177bd874949009 Mon Sep 17 00:00:00 2001
2+
From: Lukas Krug <lukas.krug@stackable.tech>
3+
Date: Wed, 27 May 2026 21:58:48 +0200
4+
Subject: Apply max response header size to Jetty maxResponseHeaderSize
5+
6+
---
7+
.../src/main/java/io/airlift/http/server/HttpServer.java | 2 +-
8+
.../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 +
9+
2 files changed, 2 insertions(+), 1 deletion(-)
10+
11+
diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServer.java b/http-server/src/main/java/io/airlift/http/server/HttpServer.java
12+
index 49a7de9374..fe3fa345aa 100644
13+
--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java
14+
+++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java
15+
@@ -204,7 +204,7 @@ public class HttpServer
16+
baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes()));
17+
}
18+
if (config.getMaxResponseHeaderSize() != null) {
19+
- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes()));
20+
+ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes()));
21+
}
22+
if (config.getOutputBufferSize() != null) {
23+
baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes()));
24+
diff --git a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
25+
index ee53d470f6..3abbfeaabb 100644
26+
--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
27+
+++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java
28+
@@ -387,6 +387,7 @@ public class HttpServerConfig
29+
return this;
30+
}
31+
32+
+ @MaxDataSize("1GB")
33+
public DataSize getMaxResponseHeaderSize()
34+
{
35+
return maxResponseHeaderSize;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mirror = "https://github.com/stackabletech/airlift.git"
2+
base = "edaccb04be472282c74507af9b7c38470b385685"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
upstream = "https://github.com/airlift/airlift.git"
2+
default-mirror = "https://github.com/stackabletech/airlift.git"

trino/trino/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
22
# check=error=true
3+
FROM local-image/trino/airlift AS airlift-builder
4+
35
FROM local-image/java-devel AS trino-builder
46

57
ARG PRODUCT_VERSION
68
ARG RELEASE_VERSION
79
ARG STACKABLE_USER_UID
10+
ARG TRINO_AIRLIFT_VERSION
811

912
WORKDIR /stackable
1013

1114
COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/patchable.toml /stackable/src/trino/trino/stackable/patches/patchable.toml
1215
COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/trino/stackable/patches/${PRODUCT_VERSION}
16+
COPY --chown=${STACKABLE_USER_UID}:0 --from=airlift-builder /stackable/patched-libs /stackable/patched-libs
1317

1418
# adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980
1519
# hadolint ignore=SC2215
1620
RUN --mount=type=cache,id=maven-${PRODUCT_VERSION},target=/root/.m2/repository <<EOF
1721
cd "$(/stackable/patchable --images-repo-root=src checkout trino/trino ${PRODUCT_VERSION})"
1822

23+
# Make Maven aware of the patched Airlift artifacts before resolving deps
24+
cp -r /stackable/patched-libs/maven/* /root/.m2/repository
25+
1926
NEW_VERSION="${PRODUCT_VERSION}-stackable${RELEASE_VERSION}"
2027

2128
mvn versions:set -DnewVersion=$NEW_VERSION
@@ -49,6 +56,7 @@ mvn \
4956
-Dcheckstyle.skip `# Skip checkstyle checks. We dont care if the code is properly formatted, it just wastes time` \
5057
-Dmaven.javadoc.skip=true `# Dont generate javadoc` \
5158
-Ddep.presto-jdbc-under-test=${NEW_VERSION} \
59+
-Ddep.airlift.version=${TRINO_AIRLIFT_VERSION}-stackable${RELEASE_VERSION} `# Use Stackable-patched Airlift; see local-image/trino/airlift` \
5260
--projects="$SKIP_PROJECTS"
5361

5462
mkdir -p /stackable/patched-libs/maven/io

trino/trino/boil-config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[versions."477".local-images]
22
java-devel = "24"
3+
# Airlift version comes from <dep.airlift.version> in
4+
# https://github.com/trinodb/trino/blob/477/pom.xml
5+
"trino/airlift" = "361"
36

47
[versions."479".local-images]
58
java-devel = "25"
9+
# Airlift version comes from <dep.airlift.version> in
10+
# https://github.com/trinodb/trino/blob/479/pom.xml
11+
"trino/airlift" = "386"

0 commit comments

Comments
 (0)