- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem
When encoding fails in the S3 sink request builder, the batch is silently acknowledged as delivered upstream, causing undetected data loss.
What currently happens: If an event batch fails to encode (e.g., schema violation, serialization error), the error is logged via SinkRequestBuildError but the batch finalizers are dropped without signaling failure. Dropping finalizers defaults to signaling success, so upstream components (sources with end-to-end acknowledgements) believe the data was delivered.
What should happen: Encoding failures should reject the batch finalizers so upstream components know the data was not delivered and can retry or report the failure.
The root cause is in the request builder flow:
split_input (src/sinks/aws_s3/sink.rs) calls events.take_finalizers() and stores them in S3Metadata before encoding
encode_events is called after finalizers are already taken
- If encoding fails,
src/sinks/s3_common/sink.rs:55-62 catches the error via filter_map, logs it, and returns None
- The
S3Metadata (owning the finalizers) is dropped, which signals successful delivery
This is a pre-existing issue that becomes more impactful as new encoding formats (Parquet, Arrow) introduce more encode-time failure modes (strict schema violations, type coercion errors, etc.).
Configuration
Any S3 sink configuration where encoding can fail at runtime, e.g.:
sinks:
s3:
type: aws_s3
bucket: my-bucket
batch_encoding:
codec: parquet
schema_mode: strict
schema_file: /path/to/schema.schema
encoding:
codec: text
Version
0.54.0
Debug Output
The only observable signal is a SinkRequestBuildError log line. No acknowledgement failure is reported upstream.
Additional Context
This affects any sink using the RequestBuilder pattern in src/sinks/util/request_builder.rs where encoding happens after split_input takes finalizers. The S3 sink is the most notable case.
Possible fixes:
- Move encoding before finalizer extraction so failures can reject the batch properly
- Explicitly reject finalizers (signal failure) when encoding fails, rather than dropping them silently
References
Problem
When encoding fails in the S3 sink request builder, the batch is silently acknowledged as delivered upstream, causing undetected data loss.
What currently happens: If an event batch fails to encode (e.g., schema violation, serialization error), the error is logged via
SinkRequestBuildErrorbut the batch finalizers are dropped without signaling failure. Dropping finalizers defaults to signaling success, so upstream components (sources with end-to-end acknowledgements) believe the data was delivered.What should happen: Encoding failures should reject the batch finalizers so upstream components know the data was not delivered and can retry or report the failure.
The root cause is in the request builder flow:
split_input(src/sinks/aws_s3/sink.rs) callsevents.take_finalizers()and stores them inS3Metadatabefore encodingencode_eventsis called after finalizers are already takensrc/sinks/s3_common/sink.rs:55-62catches the error viafilter_map, logs it, and returnsNoneS3Metadata(owning the finalizers) is dropped, which signals successful deliveryThis is a pre-existing issue that becomes more impactful as new encoding formats (Parquet, Arrow) introduce more encode-time failure modes (strict schema violations, type coercion errors, etc.).
Configuration
Any S3 sink configuration where encoding can fail at runtime, e.g.:
Version
0.54.0
Debug Output
The only observable signal is a
SinkRequestBuildErrorlog line. No acknowledgement failure is reported upstream.Additional Context
This affects any sink using the
RequestBuilderpattern insrc/sinks/util/request_builder.rswhere encoding happens aftersplit_inputtakes finalizers. The S3 sink is the most notable case.Possible fixes:
References
Deliveredwhen failing to build a partition key #23366 (same class of bug:EventStatusmarked asDeliveredwhen failing to build a partition key)