GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [connectors] Kafka tests: do not fail on transient transport errors. · feldera/feldera@2c7a1a7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/connectors/src/transport/kafka/ft
    • test.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/connectors/src/transport/kafka/ft/test.rs‎

Copy file name to clipboardExpand all lines: crates/connectors/src/transport/kafka/ft/test.rs
+23-7Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::single_range_in_vec_init)]
88

99
use crate::{
10-
InputBuffer, InputConsumer, ParseError, Parser,
10+
ControllerError, InputBuffer, InputConsumer, ParseError, Parser,
1111
format::{Splitter, SpongeSplitter},
1212
test::{
1313
engine_test, input_pipeline,
@@ -2175,7 +2175,13 @@ fn check_fault_tolerance(
21752175
.controller(
21762176
&circuit,
21772177
&config,
2178-
Box::new(move |error, _| panic!("error: {error}")),
2178+
Box::new(move |error, _| {
2179+
if is_transient(&error) {
2180+
info!("ignored error: {error}")
2181+
} else {
2182+
panic!("error: {error}")
2183+
}
2184+
}),
21792185
)
21802186
.unwrap();
21812187
controller.start();
@@ -2946,18 +2952,18 @@ pub fn buffer(engine: &dyn PipelineTestEngine) {
29462952
.unwrap();
29472953

29482954
// Once the topics are gone, endpoint threads may still report errors, which must not
2949-
// fail the case.
2955+
// fail the case. Transient errors must not fail it either.
29502956
let running = Arc::new(AtomicBool::new(true));
29512957
let running_clone = running.clone();
29522958
let controller = engine
29532959
.controller(
29542960
&TestCircuit::identity(relation()),
29552961
&config,
29562962
Box::new(move |error, _| {
2957-
if running_clone.load(Ordering::Acquire) {
2963+
if running_clone.load(Ordering::Acquire) && !is_transient(&error) {
29582964
panic!("buffer: error: {error}")
29592965
} else {
2960-
info!("buffer: error after the topics are gone: {error}")
2966+
info!("buffer: ignored error: {error}")
29612967
}
29622968
}),
29632969
)
@@ -3012,6 +3018,16 @@ pub fn buffer(engine: &dyn PipelineTestEngine) {
30123018
running.store(false, Ordering::Release);
30133019
}
30143020

3021+
/// Returns true if `error` is a non-fatal transport error, such as `UnknownPartition` while
3022+
/// a new topic's metadata spreads across the brokers. The endpoint retries these itself.
3023+
fn is_transient(error: &ControllerError) -> bool {
3024+
matches!(
3025+
error,
3026+
ControllerError::InputTransportError { fatal: false, .. }
3027+
| ControllerError::OutputTransportError { fatal: false, .. }
3028+
)
3029+
}
3030+
30153031
/// Checks a pipeline that reads CSV `data` from an input topic and writes it in `format`
30163032
/// with `format_config` to an output topic, in messages of at most `message_max_bytes`.
30173033
fn check_end_to_end(
@@ -3071,10 +3087,10 @@ fn check_end_to_end(
30713087
&TestCircuit::identity(relation()),
30723088
&config,
30733089
Box::new(move |error, _| {
3074-
if running_clone.load(Ordering::Acquire) {
3090+
if running_clone.load(Ordering::Acquire) && !is_transient(&error) {
30753091
panic!("{name}: error: {error}")
30763092
} else {
3077-
info!("{name}: error after the topics are gone: {error}")
3093+
info!("{name}: ignored error: {error}")
30783094
}
30793095
}),
30803096
)

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.