-
-
Notifications
You must be signed in to change notification settings - Fork 6
fix: logback fix for NiFi / NiFi 2.6 build fix #1314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5c77e0e
feat: patch logback in NiFi 2.4.0 build
dervoeti 1764492
fix: pin esbuild to fix NiFi 2.6.0 build
dervoeti 0073597
feat: include the logback patch in NiFi 2.6.0
dervoeti 4ced764
fix: pin esbuild to fix NiFi 2.6.0 build
dervoeti e2ddf25
feat: build NiFi 1.x with the logback fix
dervoeti c4677bf
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 2eb59c6
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 6ed110a
chore: changelog
dervoeti b101bad
Merge branch 'main' into spike/nifi-patch-logback
NickLarsenNZ dc6ce56
Apply suggestions from code review
NickLarsenNZ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
nifi/stackable/patches/2.6.0/0005-fix-pin-esbuild-to-fix-NiFi-2.6.0-build.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| From 1fe22dcc974b52d83b8288d5279c3aa8c41a1243 Mon Sep 17 00:00:00 2001 | ||
| From: dervoeti <[email protected]> | ||
| Date: Wed, 22 Oct 2025 15:27:29 +0200 | ||
| Subject: fix: pin esbuild to fix NiFi 2.6.0 build | ||
|
|
||
| For some reason, npm tries to use a newer version of esbuild than the version in the lock file. I suspect this might be related to how npm handles optional dependencies in lock files. The esbuild version is set to 0.25.10 now to prevent npm from trying to select a newer version, so that the same packages as in the original NiFi build are used. | ||
| --- | ||
| nifi-frontend/src/main/frontend/package.json | 5 +++-- | ||
| 1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/nifi-frontend/src/main/frontend/package.json b/nifi-frontend/src/main/frontend/package.json | ||
| index ee125e7663..6914c5f00c 100644 | ||
| --- a/nifi-frontend/src/main/frontend/package.json | ||
| +++ b/nifi-frontend/src/main/frontend/package.json | ||
| @@ -114,10 +114,11 @@ | ||
| "vite": "^5.4.6", | ||
| "underscore": "1.13.6", | ||
| "rollup": "4.22.4", | ||
| - "esbuild": "^0.25.8", | ||
| + "esbuild": "0.25.10", | ||
| "koa": "^2.16.1" | ||
| }, | ||
| "overrides": { | ||
| - "koa": "^2.16.1" | ||
| + "koa": "^2.16.1", | ||
| + "esbuild": "0.25.10" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # syntax=docker/dockerfile:1.15.1@sha256:9857836c9ee4268391bb5b09f9f157f3c91bb15821bb77969642813b0d00518d | ||
| # check=error=true | ||
|
|
||
| FROM local-image/java-devel AS builder | ||
|
|
||
| ARG PRODUCT_VERSION | ||
| ARG RELEASE_VERSION | ||
| ARG STACKABLE_USER_UID | ||
|
|
||
| COPY --chown=${STACKABLE_USER_UID}:0 shared/logback/stackable/patches/patchable.toml /stackable/src/shared/logback/stackable/patches/patchable.toml | ||
| COPY --chown=${STACKABLE_USER_UID}:0 shared/logback/stackable/patches/${PRODUCT_VERSION} /stackable/src/shared/logback/stackable/patches/${PRODUCT_VERSION} | ||
|
|
||
| USER ${STACKABLE_USER_UID} | ||
| WORKDIR /stackable | ||
|
|
||
| RUN <<EOF | ||
| cd "$(/stackable/patchable --images-repo-root=src checkout shared/logback ${PRODUCT_VERSION})" | ||
|
|
||
| # Create snapshot of the source code including custom patches | ||
| tar -czf /stackable/logback-${PRODUCT_VERSION}-src.tar.gz . | ||
|
|
||
| mvn --batch-mode --no-transfer-progress clean install -DskipTests -Dmaven.test.skip=true -Dmaven.javadoc.skip=true | ||
| EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [versions."1.3.14".local-images] | ||
| java-devel = "21" | ||
|
|
||
| [versions."1.5.18".local-images] | ||
| java-devel = "21" |
38 changes: 38 additions & 0 deletions
38
.../stackable/patches/1.3.14/0001-fix-move-StringBuilder-into-function-to-prevent-race.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| From 2ee74eaf5645576ec0a604941591c9ae09a92a43 Mon Sep 17 00:00:00 2001 | ||
| From: dervoeti <[email protected]> | ||
| Date: Wed, 22 Oct 2025 11:13:02 +0200 | ||
| Subject: fix: move StringBuilder into function to prevent race conditions | ||
|
|
||
| --- | ||
| .../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. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| mirror = "https://github.com/stackabletech/logback.git" | ||
| base = "39fc5461e7a8e15ce9ecd9f148f67f701aed88ad" |
38 changes: 38 additions & 0 deletions
38
.../stackable/patches/1.5.18/0001-fix-move-StringBuilder-into-function-to-prevent-race.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| From 174aa552f3f1fc03dcce3b37f24993b77b90ab71 Mon Sep 17 00:00:00 2001 | ||
| From: dervoeti <[email protected]> | ||
| Date: Fri, 17 Oct 2025 12:07:51 +0200 | ||
| Subject: fix: move StringBuilder into function to prevent race conditions | ||
|
|
||
| --- | ||
| .../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. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| mirror = "https://github.com/stackabletech/logback.git" | ||
| base = "b2a02f065379a9b1ba5ff837fc08913b744774bc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| upstream = "https://github.com/qos-ch/logback.git" | ||
| default-mirror = "https://github.com/stackabletech/logback.git" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.