fix(producer): treat kafka_storage_error as retriable - #667
Merged
zmstone merged 1 commit intoJul 19, 2026
Merged
Conversation
whatyouhide
force-pushed
the
260714-producer-retry-kafka-storage-error
branch
from
July 14, 2026 15:27
616e2f7 to
70f6e18
Compare
whatyouhide
marked this pull request as ready for review
July 14, 2026 15:28
zmstone
approved these changes
Jul 19, 2026
Contributor
|
thank you for the pr.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey all! Andrea from the Elixir core team here.
We just started using
brod(underbroadway_kafka) at Knock, for communicating with WarpStream.This PR adds
?kafka_storage_error(KAFKA_STORAGE_ERROR, error code 56) tobrod_producer:is_retriable/1, so a produce response carrying it nacks the buffer and schedules a retry (same path asrequest_timed_out) instead of exiting the producer with{not_retriable, _}.The idea is that the Kafka protocol classifies error 56 as Retriable=True ("Disk error when trying to access log file on the disk"; see the protocol error table). For example, the Java client automatically retries it on Produce.
brodcurrently treats it as fatal.The failure mode is worse than a plain error:
exit({not_retriable, _})kills the producer and loses its whole internal buffer, so a transient broker-side storage blip becomes message loss for any caller that doesn't wrap brod in its own retry layer.We noticed this because we use WarpStream (Kafka-compatible, S3-backed), which uses
KAFKA_STORAGE_ERRORas its generic "back off and retry" code. Their docs explicitly call it "a retriable error code" and several changelog entries pick error 56 precisely because compliant clients treat it as transient.I'm opening this because in production we observed a single WarpStream-side blip take down a bunch of
brodproducers (across 12 pods within 15ms 😮), all with{not_retriable, {produce_response_error, Topic, Partition, -1, kafka_storage_error}}.