This is an automated email from the ASF dual-hosted git repository.

Jackie-Jiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new dfaa2dd2af8 Throw stackless exceptions from test failure injection to 
reduce log noise (#19293)
dfaa2dd2af8 is described below

commit dfaa2dd2af8a51a5a129d1631c9c96126a17cdd9
Author: Xiaotian (Jackie) Jiang <[email protected]>
AuthorDate: Tue Aug 18 16:30:10 2026 -0700

    Throw stackless exceptions from test failure injection to reduce log noise 
(#19293)
---
 .../controller/helix/core/util/FailureInjectionUtils.java     | 11 ++++++++++-
 .../utils/FailureInjectingRealtimeSegmentDataManager.java     |  5 +++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/FailureInjectionUtils.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/FailureInjectionUtils.java
index 2f19a2b9d97..cbe4fa06304 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/FailureInjectionUtils.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/FailureInjectionUtils.java
@@ -32,7 +32,16 @@ public class FailureInjectionUtils {
   public static void injectFailure(String faultTypeKey, Map<String, String> 
managerConfigs) {
     String faultTypeConfig = managerConfigs.getOrDefault(faultTypeKey, 
"false");
     if (Boolean.parseBoolean(faultTypeConfig)) {
-      throw new RuntimeException("Injecting failure: " + faultTypeKey);
+      throw new InjectedFailureException("Injecting failure: " + faultTypeKey);
+    }
+  }
+
+  /// Thrown at a configured fault point. Carries no stack trace: these 
failures are thrown by design, often for
+  /// dozens of segments per test, and the catch sites log them in full — the 
fault point in the message is the only
+  /// meaningful context, so stack traces would just flood the test logs.
+  public static class InjectedFailureException extends RuntimeException {
+    public InjectedFailureException(String message) {
+      super(message, null, false, false);
     }
   }
 }
diff --git 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/realtime/utils/FailureInjectingRealtimeSegmentDataManager.java
 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/realtime/utils/FailureInjectingRealtimeSegmentDataManager.java
index eeb6d1ea31d..08dbf8ce3da 100644
--- 
a/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/realtime/utils/FailureInjectingRealtimeSegmentDataManager.java
+++ 
b/pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/realtime/utils/FailureInjectingRealtimeSegmentDataManager.java
@@ -22,6 +22,7 @@ import java.util.function.BooleanSupplier;
 import org.apache.pinot.common.metadata.segment.SegmentZKMetadata;
 import org.apache.pinot.common.metrics.ServerMetrics;
 import org.apache.pinot.common.utils.LLCSegmentName;
+import org.apache.pinot.controller.helix.core.util.FailureInjectionUtils;
 import org.apache.pinot.core.data.manager.realtime.ConsumerCoordinator;
 import org.apache.pinot.core.data.manager.realtime.RealtimeSegmentDataManager;
 import org.apache.pinot.core.data.manager.realtime.RealtimeTableDataManager;
@@ -53,7 +54,7 @@ public class FailureInjectingRealtimeSegmentDataManager 
extends RealtimeSegmentD
         llcSegmentName, consumerCoordinator, serverMetrics, null /* no 
PartitionUpsertMetadataManager */,
         partitionDedupMetadataManager, isTableReadyToConsumeData);
     if (failConsumingTransition) {
-      throw new RuntimeException("Forced to fail the consuming transition");
+      throw new FailureInjectionUtils.InjectedFailureException("Forced to fail 
the consuming transition");
     }
     _failCommit = failCommit;
   }
@@ -61,7 +62,7 @@ public class FailureInjectingRealtimeSegmentDataManager 
extends RealtimeSegmentD
   protected SegmentBuildDescriptor buildSegmentInternal(boolean forCommit)
       throws SegmentBuildFailureException {
     if (_failCommit) {
-      throw new RuntimeException("Forced failure in buildSegmentInternal");
+      throw new FailureInjectionUtils.InjectedFailureException("Forced failure 
in buildSegmentInternal");
     }
     return super.buildSegmentInternal(forCommit);
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to