Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ All notable changes to this project will be documented in this file.
- superset: Fix the 4.1.2 build when building from source ([#1309])
- superset: Pin `luxon` to version 3.6.1 to fix build ([#1315], [#1316])
- nifi: Use a patched version of logback to fix corrupted logs ([#1314])
- zookeeper: Use a patched version of logback to fix corrupted logs ([#1320])

### Fixed

Expand Down Expand Up @@ -117,6 +118,7 @@ All notable changes to this project will be documented in this file.
[#1316]: https://github.com/stackabletech/docker-images/pull/1316
[#1318]: https://github.com/stackabletech/docker-images/pull/1318
[#1319]: https://github.com/stackabletech/docker-images/pull/1319
[#1320]: https://github.com/stackabletech/docker-images/pull/1320

## [25.7.0] - 2025-07-23

Expand Down
6 changes: 6 additions & 0 deletions shared/logback/boil-config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[versions."1.2.13".local-images]
java-devel = "8"

[versions."1.3.14".local-images]
java-devel = "21"

[versions."1.3.15".local-images]
java-devel = "21"

[versions."1.5.18".local-images]
java-devel = "21"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 2f94a71b44275028e99fcf4f7540ae694a1d68c7 Mon Sep 17 00:00:00 2001
From: Andrew Kenworthy <andrew.kenworthy@stackable.tech>
Date: Mon, 27 Oct 2025 15:58:12 +0100
Subject: fix: move StringBuilder into function to prevent race

---
.../java/ch/qos/logback/classic/log4j/XMLLayout.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
index ee640eeb6..edda3e9fb 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
@@ -38,9 +38,7 @@ import ch.qos.logback.core.helpers.Transform;
public class XMLLayout extends LayoutBase<ILoggingEvent> {

private final int DEFAULT_SIZE = 256;
- private final int UPPER_LIMIT = 2048;

- private StringBuilder buf = new StringBuilder(DEFAULT_SIZE);
private boolean locationInfo = false;
private boolean properties = false;

@@ -96,13 +94,7 @@ public class XMLLayout extends LayoutBase<ILoggingEvent> {
*/
public String doLayout(ILoggingEvent event) {

- // Reset working buffer. If the buffer is too large, then we need a new
- // one in order to avoid the penalty of creating a large array.
- if (buf.capacity() > UPPER_LIMIT) {
- buf = new StringBuilder(DEFAULT_SIZE);
- } else {
- buf.setLength(0);
- }
+ StringBuilder buf = new StringBuilder(DEFAULT_SIZE);

// We yield to the \r\n heresy.

2 changes: 2 additions & 0 deletions shared/logback/stackable/patches/1.2.13/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mirror = "https://github.com/stackabletech/logback.git"
base = "2648b9e7fbb47426c89b9c93b411c07484e8f277"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From afa8af8c6574806e2482063a301130562a8f2b0d Mon Sep 17 00:00:00 2001
From: Andrew Kenworthy <andrew.kenworthy@stackable.tech>
Date: Mon, 27 Oct 2025 16:00:59 +0100
Subject: fix: move StringBuilder into function to prevent race

---
.../java/ch/qos/logback/classic/log4j/XMLLayout.java | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
index 4bc04388a..405f4ef26 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/log4j/XMLLayout.java
@@ -38,9 +38,7 @@ import ch.qos.logback.core.helpers.Transform;
public class XMLLayout extends LayoutBase<ILoggingEvent> {

private final int DEFAULT_SIZE = 256;
- private final int UPPER_LIMIT = 2048;

- private StringBuilder buf = new StringBuilder(DEFAULT_SIZE);
private boolean locationInfo = false;
private boolean properties = false;

@@ -96,13 +94,7 @@ public class XMLLayout extends LayoutBase<ILoggingEvent> {
*/
public String doLayout(ILoggingEvent event) {

- // Reset working buffer. If the buffer is too large, then we need a new
- // one in order to avoid the penalty of creating a large array.
- if (buf.capacity() > UPPER_LIMIT) {
- buf = new StringBuilder(DEFAULT_SIZE);
- } else {
- buf.setLength(0);
- }
+ StringBuilder buf = new StringBuilder(DEFAULT_SIZE);

// We yield to the \r\n heresy.

2 changes: 2 additions & 0 deletions shared/logback/stackable/patches/1.3.15/patchable.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mirror = "https://github.com/stackabletech/logback.git"
base = "81f8c25e2a2fae99f45029c27dc793bdaa8cb079"
9 changes: 9 additions & 0 deletions zookeeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# ==============================================================================
# START ZOOKEEPER BUILDER

FROM local-image/shared/logback AS patched-logback

FROM local-image/java-devel AS builder

ARG PRODUCT_VERSION
Expand All @@ -16,12 +18,16 @@ COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/patches/patchable.toml
COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/patches/${PRODUCT_VERSION} /stackable/src/zookeeper/stackable/patches/${PRODUCT_VERSION}
# Copy JMX config into the builder
COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/jmx /stackable/jmx
COPY --chown=${STACKABLE_USER_UID}:0 --from=patched-logback /stackable/.m2/repository /stackable/patched-logback-libs

USER ${STACKABLE_USER_UID}
WORKDIR /stackable

# Download ZooKeeper sources from our own repo
RUN <<EOF
mkdir -p /stackable/.m2/repository
cp -r /stackable/patched-logback-libs/* /stackable/.m2/repository

cd "$(/stackable/patchable --images-repo-root=src checkout zookeeper ${PRODUCT_VERSION})"

ORIGINAL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
Expand Down Expand Up @@ -84,6 +90,8 @@ LABEL \
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}-bin /stackable/apache-zookeeper-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}-bin/
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/zookeeper-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}-src.tar.gz /stackable
COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
# Copy over the patched logback files
COPY --chown=${STACKABLE_USER_UID}:0 --from=patched-logback /stackable/*-src.tar.gz /stackable
COPY zookeeper/licenses /licenses

RUN <<EOF
Expand All @@ -102,6 +110,7 @@ chown -h ${STACKABLE_USER_UID}:0 /stackable/zookeeper
# fix missing permissions
chmod g=u /stackable/jmx
chmod g=u /stackable/apache-zookeeper-${PRODUCT_VERSION}-stackable${RELEASE_VERSION}-bin/
chmod g=u /stackable/*-src.tar.gz
EOF

# ----------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions zookeeper/boil-config.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
[versions."3.9.3".local-images]
java-base = "17"
java-devel = "11"
"shared/logback" = "1.2.13"

[versions."3.9.3".build-arguments]
jmx-exporter-version = "1.4.0"

[versions."3.9.4".local-images]
java-base = "17"
java-devel = "11"
"shared/logback" = "1.3.15"

[versions."3.9.4".build-arguments]
jmx-exporter-version = "1.4.0"