From 6313e2a9983ac37c7744138f7cd4fe68dc9b77fe Mon Sep 17 00:00:00 2001 From: dervoeti Date: Tue, 26 May 2026 11:24:42 +0200 Subject: [PATCH 1/4] fix(trino): Backport airlift/airlift#1943 for max response header size --- CHANGELOG.md | 2 + trino/airlift/Dockerfile | 39 +++++++++++++++++++ trino/airlift/boil-config.toml | 5 +++ ...se-header-size-to-Jetty-maxResponseH.patch | 24 ++++++++++++ .../stackable/patches/361/patchable.toml | 2 + ...se-header-size-to-Jetty-maxResponseH.patch | 24 ++++++++++++ .../stackable/patches/386/patchable.toml | 2 + .../airlift/stackable/patches/patchable.toml | 2 + trino/trino/Dockerfile | 8 ++++ trino/trino/boil-config.toml | 2 + 10 files changed, 110 insertions(+) create mode 100644 trino/airlift/Dockerfile create mode 100644 trino/airlift/boil-config.toml create mode 100644 trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch create mode 100644 trino/airlift/stackable/patches/361/patchable.toml create mode 100644 trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch create mode 100644 trino/airlift/stackable/patches/386/patchable.toml create mode 100644 trino/airlift/stackable/patches/patchable.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f391a122..2e32c5b49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. - opensearch: Scope CycloneDX SBOM to shipped components only, eliminating false positive CVEs from unshipped plugins ([#1452]). - vector: Look for SBOM in correct location ([#1471]). - vector: Use correct license ([#1476]). +- 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` ([#XXXX]). [#1446]: https://github.com/stackabletech/docker-images/pull/1446 [#1452]: https://github.com/stackabletech/docker-images/pull/1452 @@ -32,6 +33,7 @@ All notable changes to this project will be documented in this file. [#1474]: https://github.com/stackabletech/docker-images/pull/1474 [#1476]: https://github.com/stackabletech/docker-images/pull/1476 [#1481]: https://github.com/stackabletech/docker-images/pull/1481 +[#XXXX]: https://github.com/stackabletech/docker-images/pull/XXXX ## [26.3.0] - 2026-03-16 diff --git a/trino/airlift/Dockerfile b/trino/airlift/Dockerfile new file mode 100644 index 000000000..1858a032a --- /dev/null +++ b/trino/airlift/Dockerfile @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7 +# check=error=true + +# We use a custom patched airlift version to fast track https://github.com/airlift/airlift/pull/1943 +# This can be removed once the PR is merged and Trino makes use of the new Airlift version containing the fix + +FROM local-image/java-devel AS airlift-builder + +ARG PRODUCT_VERSION +ARG RELEASE_VERSION +ARG STACKABLE_USER_UID + +WORKDIR /stackable + +COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/patchable.toml /stackable/src/trino/airlift/stackable/patches/patchable.toml +COPY --chown=${STACKABLE_USER_UID}:0 trino/airlift/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/airlift/stackable/patches/${PRODUCT_VERSION} + +# hadolint ignore=SC2215 +RUN --mount=type=cache,id=maven-airlift-${PRODUCT_VERSION},target=/root/.m2/repository < +Date: Mon, 25 May 2026 15:25:18 +0200 +Subject: Apply max response header size to Jetty maxResponseHeaderSize + +--- + .../src/main/java/io/airlift/http/server/HttpServer.java | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +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 +index 6da8193eb..d43d795e7 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +@@ -193,7 +193,9 @@ public class HttpServer + baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); + } + if (config.getMaxResponseHeaderSize() != null) { +- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); ++ int maxResponseHeaderSizeBytes = toIntExact(config.getMaxResponseHeaderSize().toBytes()); ++ baseHttpConfiguration.setResponseHeaderSize(maxResponseHeaderSizeBytes); ++ baseHttpConfiguration.setMaxResponseHeaderSize(maxResponseHeaderSizeBytes); + } + if (config.getOutputBufferSize() != null) { + baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); diff --git a/trino/airlift/stackable/patches/361/patchable.toml b/trino/airlift/stackable/patches/361/patchable.toml new file mode 100644 index 000000000..ceb89b96d --- /dev/null +++ b/trino/airlift/stackable/patches/361/patchable.toml @@ -0,0 +1,2 @@ +mirror = "https://github.com/stackabletech/airlift.git" +base = "69314d3f2d3a72533704b8ef08d68b23875c5513" diff --git a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch new file mode 100644 index 000000000..d3ac2151d --- /dev/null +++ b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -0,0 +1,24 @@ +From c3efb84821ee56d72dab45373d316c854583f351 Mon Sep 17 00:00:00 2001 +From: dervoeti +Date: Mon, 25 May 2026 15:25:18 +0200 +Subject: Apply max response header size to Jetty maxResponseHeaderSize + +--- + .../src/main/java/io/airlift/http/server/HttpServer.java | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +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 +index 49a7de937..390255320 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java +@@ -204,7 +204,9 @@ public class HttpServer + baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); + } + if (config.getMaxResponseHeaderSize() != null) { +- baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); ++ int maxResponseHeaderSizeBytes = toIntExact(config.getMaxResponseHeaderSize().toBytes()); ++ baseHttpConfiguration.setResponseHeaderSize(maxResponseHeaderSizeBytes); ++ baseHttpConfiguration.setMaxResponseHeaderSize(maxResponseHeaderSizeBytes); + } + if (config.getOutputBufferSize() != null) { + baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); diff --git a/trino/airlift/stackable/patches/386/patchable.toml b/trino/airlift/stackable/patches/386/patchable.toml new file mode 100644 index 000000000..5c7639fbe --- /dev/null +++ b/trino/airlift/stackable/patches/386/patchable.toml @@ -0,0 +1,2 @@ +mirror = "https://github.com/stackabletech/airlift.git" +base = "edaccb04be472282c74507af9b7c38470b385685" diff --git a/trino/airlift/stackable/patches/patchable.toml b/trino/airlift/stackable/patches/patchable.toml new file mode 100644 index 000000000..7db05dd49 --- /dev/null +++ b/trino/airlift/stackable/patches/patchable.toml @@ -0,0 +1,2 @@ +upstream = "https://github.com/airlift/airlift.git" +default-mirror = "https://github.com/stackabletech/airlift.git" diff --git a/trino/trino/Dockerfile b/trino/trino/Dockerfile index dc75f3ea4..389c2b950 100644 --- a/trino/trino/Dockerfile +++ b/trino/trino/Dockerfile @@ -1,21 +1,28 @@ # syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7 # check=error=true +FROM local-image/trino/airlift AS airlift-builder + FROM local-image/java-devel AS trino-builder ARG PRODUCT_VERSION ARG RELEASE_VERSION ARG STACKABLE_USER_UID +ARG TRINO_AIRLIFT_VERSION WORKDIR /stackable COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/patchable.toml /stackable/src/trino/trino/stackable/patches/patchable.toml COPY --chown=${STACKABLE_USER_UID}:0 trino/trino/stackable/patches/${PRODUCT_VERSION} /stackable/src/trino/trino/stackable/patches/${PRODUCT_VERSION} +COPY --chown=${STACKABLE_USER_UID}:0 --from=airlift-builder /stackable/patched-libs /stackable/patched-libs # adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980 # hadolint ignore=SC2215 RUN --mount=type=cache,id=maven-${PRODUCT_VERSION},target=/root/.m2/repository < Date: Tue, 26 May 2026 11:28:30 +0200 Subject: [PATCH 2/4] chore: changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e32c5b49..a45a27751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file. - opensearch: Scope CycloneDX SBOM to shipped components only, eliminating false positive CVEs from unshipped plugins ([#1452]). - vector: Look for SBOM in correct location ([#1471]). - vector: Use correct license ([#1476]). -- 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` ([#XXXX]). +- 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]). [#1446]: https://github.com/stackabletech/docker-images/pull/1446 [#1452]: https://github.com/stackabletech/docker-images/pull/1452 @@ -33,7 +33,7 @@ All notable changes to this project will be documented in this file. [#1474]: https://github.com/stackabletech/docker-images/pull/1474 [#1476]: https://github.com/stackabletech/docker-images/pull/1476 [#1481]: https://github.com/stackabletech/docker-images/pull/1481 -[#XXXX]: https://github.com/stackabletech/docker-images/pull/XXXX +[#1510]: https://github.com/stackabletech/docker-images/pull/1510 ## [26.3.0] - 2026-03-16 From 3f5a84e9524b9d3f75a29864251b18683b4f7c6e Mon Sep 17 00:00:00 2001 From: dervoeti Date: Wed, 27 May 2026 22:13:59 +0200 Subject: [PATCH 3/4] fix: add 1GB limit --- ...se-header-size-to-Jetty-maxResponseH.patch | 31 +++++++++++++------ ...se-header-size-to-Jetty-maxResponseH.patch | 31 +++++++++++++------ 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch index b389043ef..51ddfb124 100644 --- a/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch +++ b/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -1,24 +1,35 @@ -From 1c8349ce1ce8397896db17aca28661a2b4fb1e4f Mon Sep 17 00:00:00 2001 -From: dervoeti -Date: Mon, 25 May 2026 15:25:18 +0200 +From 679fd94b89dbb51c704a7602b94e9d492d7c1a8f Mon Sep 17 00:00:00 2001 +From: Lukas Krug +Date: Wed, 27 May 2026 21:58:48 +0200 Subject: Apply max response header size to Jetty maxResponseHeaderSize --- - .../src/main/java/io/airlift/http/server/HttpServer.java | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) + .../src/main/java/io/airlift/http/server/HttpServer.java | 2 +- + .../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -index 6da8193eb..d43d795e7 100644 +index 6da8193ebe..5a8f4009bf 100644 --- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java +++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java -@@ -193,7 +193,9 @@ public class HttpServer +@@ -193,7 +193,7 @@ public class HttpServer baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); } if (config.getMaxResponseHeaderSize() != null) { - baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); -+ int maxResponseHeaderSizeBytes = toIntExact(config.getMaxResponseHeaderSize().toBytes()); -+ baseHttpConfiguration.setResponseHeaderSize(maxResponseHeaderSizeBytes); -+ baseHttpConfiguration.setMaxResponseHeaderSize(maxResponseHeaderSizeBytes); ++ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); } if (config.getOutputBufferSize() != null) { baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); +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 +index c4ebbdf9d3..760f72347a 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +@@ -372,6 +372,7 @@ public class HttpServerConfig + return this; + } + ++ @MaxDataSize("1GB") + public DataSize getMaxResponseHeaderSize() + { + return maxResponseHeaderSize; diff --git a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch index d3ac2151d..44200734e 100644 --- a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch +++ b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -1,24 +1,35 @@ -From c3efb84821ee56d72dab45373d316c854583f351 Mon Sep 17 00:00:00 2001 -From: dervoeti -Date: Mon, 25 May 2026 15:25:18 +0200 +From 75075dd681a97e7901f1a889c02c6049bfe1b733 Mon Sep 17 00:00:00 2001 +From: Lukas Krug +Date: Wed, 27 May 2026 21:58:48 +0200 Subject: Apply max response header size to Jetty maxResponseHeaderSize --- - .../src/main/java/io/airlift/http/server/HttpServer.java | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) + .../src/main/java/io/airlift/http/server/HttpServer.java | 2 +- + .../src/main/java/io/airlift/http/server/HttpServerConfig.java | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -index 49a7de937..390255320 100644 +index 49a7de9374..fe3fa345aa 100644 --- a/http-server/src/main/java/io/airlift/http/server/HttpServer.java +++ b/http-server/src/main/java/io/airlift/http/server/HttpServer.java -@@ -204,7 +204,9 @@ public class HttpServer +@@ -204,7 +204,7 @@ public class HttpServer baseHttpConfiguration.setRequestHeaderSize(toIntExact(config.getMaxRequestHeaderSize().toBytes())); } if (config.getMaxResponseHeaderSize() != null) { - baseHttpConfiguration.setResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); -+ int maxResponseHeaderSizeBytes = toIntExact(config.getMaxResponseHeaderSize().toBytes()); -+ baseHttpConfiguration.setResponseHeaderSize(maxResponseHeaderSizeBytes); -+ baseHttpConfiguration.setMaxResponseHeaderSize(maxResponseHeaderSizeBytes); ++ baseHttpConfiguration.setMaxResponseHeaderSize(toIntExact(config.getMaxResponseHeaderSize().toBytes())); } if (config.getOutputBufferSize() != null) { baseHttpConfiguration.setOutputBufferSize(toIntExact(config.getOutputBufferSize().toBytes())); +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 +index ee53d470f6..3abbfeaabb 100644 +--- a/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java ++++ b/http-server/src/main/java/io/airlift/http/server/HttpServerConfig.java +@@ -387,6 +387,7 @@ public class HttpServerConfig + return this; + } + ++ @MaxDataSize("1GB") + public DataSize getMaxResponseHeaderSize() + { + return maxResponseHeaderSize; From fe40717be6833adb7743adb7015b139efee5d5a3 Mon Sep 17 00:00:00 2001 From: dervoeti Date: Thu, 28 May 2026 09:13:24 +0200 Subject: [PATCH 4/4] chore: add airlift version comment / fix mail address --- ...Apply-max-response-header-size-to-Jetty-maxResponseH.patch | 4 ++-- ...Apply-max-response-header-size-to-Jetty-maxResponseH.patch | 4 ++-- trino/trino/boil-config.toml | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch index 51ddfb124..53c1f3561 100644 --- a/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch +++ b/trino/airlift/stackable/patches/361/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -1,5 +1,5 @@ -From 679fd94b89dbb51c704a7602b94e9d492d7c1a8f Mon Sep 17 00:00:00 2001 -From: Lukas Krug +From 846dafacf01735c4eb507959f7b9456d8fe8ebdc Mon Sep 17 00:00:00 2001 +From: Lukas Krug Date: Wed, 27 May 2026 21:58:48 +0200 Subject: Apply max response header size to Jetty maxResponseHeaderSize diff --git a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch index 44200734e..cd9f8f419 100644 --- a/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch +++ b/trino/airlift/stackable/patches/386/0001-Apply-max-response-header-size-to-Jetty-maxResponseH.patch @@ -1,5 +1,5 @@ -From 75075dd681a97e7901f1a889c02c6049bfe1b733 Mon Sep 17 00:00:00 2001 -From: Lukas Krug +From 359fe4dbf5154df20701cea742177bd874949009 Mon Sep 17 00:00:00 2001 +From: Lukas Krug Date: Wed, 27 May 2026 21:58:48 +0200 Subject: Apply max response header size to Jetty maxResponseHeaderSize diff --git a/trino/trino/boil-config.toml b/trino/trino/boil-config.toml index fb57a77a6..08e88edd1 100644 --- a/trino/trino/boil-config.toml +++ b/trino/trino/boil-config.toml @@ -1,7 +1,11 @@ [versions."477".local-images] java-devel = "24" +# Airlift version comes from in +# https://github.com/trinodb/trino/blob/477/pom.xml "trino/airlift" = "361" [versions."479".local-images] java-devel = "25" +# Airlift version comes from in +# https://github.com/trinodb/trino/blob/479/pom.xml "trino/airlift" = "386"