You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/08/27 11:57:30 UTC
(camel) branch main updated: chore: camel-lumberjack - fix flaky LumberjackMultiThreadIT (#25789)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 5938f5d79c49 chore: camel-lumberjack - fix flaky LumberjackMultiThreadIT (#25789)
5938f5d79c49 is described below
commit 5938f5d79c4939a16075ae4fde25c22ae12f758d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 27 13:57:22 2026 +0200
chore: camel-lumberjack - fix flaky LumberjackMultiThreadIT (#25789)
LumberjackMultiThreadIT.shouldListenToMessages only waited 5 seconds on a
CountDownLatch for all client threads to finish, but
LumberjackUtil.sendMessages() waits up to 30 seconds internally for ACKs.
Under load a thread could legitimately take longer than 5s, causing the
latch wait to time out intermittently in CI.
Widen the latch wait to 35s so it comfortably exceeds the internal 30s
ACK-wait ceiling, and reduce client-side thread oversubscription by using
NioEventLoopGroup(1) per client thread, since each client only manages a
single channel.
Co-authored-by: Claude Sonnet 5 <no...@anthropic.com>
Signed-off-by: Claus Ibsen <cl...@gmail.com>
Closes #25789
---
.../apache/camel/component/lumberjack/LumberjackMultiThreadIT.java | 6 +++++-
.../java/org/apache/camel/component/lumberjack/LumberjackUtil.java | 4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackMultiThreadIT.java b/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackMultiThreadIT.java
index 97dd9c34d6b8..ae8d51fdd188 100644
--- a/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackMultiThreadIT.java
+++ b/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackMultiThreadIT.java
@@ -80,7 +80,11 @@ public class LumberjackMultiThreadIT extends CamelTestSupport {
mock.expectedMessageCount(25 * CONCURRENCY_LEVEL);
mock.allMessages().body().isInstanceOf(Map.class);
- final boolean await = latch.await(5, TimeUnit.SECONDS);
+ // LumberjackUtil.sendMessages() waits up to 30 seconds internally for ACKs before a thread
+ // counts down the latch (that 30s bound was itself raised from Awaitility's 10s default in
+ // 5df5b4719ac1 to fix flakiness on loaded CI runners). This wait must exceed 30s with margin,
+ // or a thread that legitimately takes close to the internal max would trip this latch first.
+ final boolean await = latch.await(35, TimeUnit.SECONDS);
assertTrue(await, "All threads should have sent their messages by now");
// Then we should have the messages we're expecting
diff --git a/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackUtil.java b/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackUtil.java
index 06008beff30c..92314c7b6543 100644
--- a/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackUtil.java
+++ b/components/camel-lumberjack/src/test/java/org/apache/camel/component/lumberjack/LumberjackUtil.java
@@ -54,7 +54,9 @@ final class LumberjackUtil {
static List<Integer> sendMessages(
int port, SSLContextParameters sslContextParameters, List<Integer> windows, boolean waitForResult)
throws InterruptedException {
- NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup();
+ // A single thread is enough for one client connection; avoids oversubscribing CPU when
+ // multiple client threads each spin up their own group (default is 2x available processors).
+ NioEventLoopGroup eventLoopGroup = new NioEventLoopGroup(1);
try {
// This list will hold the acknowledgment response sequence numbers
List<Integer> responses = new ArrayList<>();