Skip to content

Commit

Permalink
fix: use match to handle non queue full error instead of assert (#11998)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabVersion authored Aug 31, 2023
1 parent 8ea014f commit e0480ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/connector/src/sink/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,13 @@ impl KafkaSinkWriter {
Err((e, rec)) => {
err = e;
record = rec;
// FIXME: Will there possibly exist other errors?
assert!(err == KafkaError::MessageProduction(RDKafkaErrorCode::QueueFull));
tokio::time::sleep(self.config.retry_interval).await;
continue;
match err {
KafkaError::MessageProduction(RDKafkaErrorCode::QueueFull) => {
tokio::time::sleep(self.config.retry_interval).await;
continue;
}
_ => break,
}
}
}
}
Expand Down

0 comments on commit e0480ea

Please sign in to comment.