Skip to content

Commit

Permalink
fix: properly handle produce operation failure (#3405)
Browse files Browse the repository at this point in the history
The failure of produce operation was mistakenly treated as a failure of the transportation layer, which is not. That led to non-helpful error reporting to the user:
```bash
Producer error: failed to get record metadata
```
Fixed by not handling return error code too early.
  • Loading branch information
Alexander Galibey committed Jul 21, 2023
1 parent c191226 commit 63f9562
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/fluvio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fluvio"
version = "0.19.3"
version = "0.19.4"
edition = "2021"
license = "Apache-2.0"
authors = ["Fluvio Contributors <team@fluvio.io>"]
Expand Down
5 changes: 0 additions & 5 deletions crates/fluvio/src/producer/partition_producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ impl PartitionProducer {
let mut futures = Vec::with_capacity(partition_count);
for topic in produce_response.responses.into_iter() {
for partition in topic.partitions {
if partition.error_code.is_error() {
return Err(FluvioError::from(ProducerError::from(
partition.error_code,
)));
}
futures.push(ProducePartitionResponseFuture::ready(
partition.base_offset,
partition.error_code,
Expand Down

0 comments on commit 63f9562

Please sign in to comment.