Skip to content

Commit 4fa497f

Browse files
authored
Merge pull request #121 from zmstone/260723-fix-offset-reply-spec
fix: add missing drop-reason atoms to offset_reply() spec
2 parents 99a2fd1 + 4e2a575 commit 4fa497f

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* 4.2.1
2+
- Fix the stale `wolff:offset_reply()` type spec: add the missing drop-reason
3+
atoms an ack callback (or `send_sync`) may receive: `partition_lost`,
4+
and the ones introduced in 4.2.0: `message_expired` (`max_batch_age`)
5+
and `max_retry_exceeded` (`max_retry`).
6+
No behavior change, spec (dialyzer) only.
7+
18
* 4.2.0
29
- Add `max_retry` producer option (default `infinity`, i.e. retry forever).
310
When set to a non-negative integer, a batch that keeps getting Kafka error

src/wolff.erl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,20 @@
6666
-type partition() :: kpro:partition().
6767
-type name() :: atom() | binary().
6868
-type offset() :: kpro:offset().
69-
-type offset_reply() :: offset() | buffer_overflow_discarded | message_too_large.
69+
%% Kafka offset for successfully produced messages (`-1' when `required_acks'
70+
%% is `none'), or the reason atom when the message is dropped instead:
71+
%% - `buffer_overflow_discarded': pushed out of the buffer by newer messages
72+
%% (replayq overflow, or high memory pressure with `drop_if_highmem').
73+
%% - `partition_lost': the partition is gone (e.g. topic deleted or shrunk).
74+
%% - `message_expired': all messages in the batch are older than `max_batch_age'.
75+
%% - `max_retry_exceeded': dropped after `max_retry' failed retries.
76+
%% - `message_too_large': a single-call batch is too large for the topic.
77+
-type offset_reply() :: offset()
78+
| buffer_overflow_discarded
79+
| partition_lost
80+
| message_expired
81+
| max_retry_exceeded
82+
| message_too_large.
7083
-type producers_cfg() :: wolff_producers:config().
7184
-type producers() :: wolff_producers:producers().
7285
-type partitioner() :: wolff_producers:partitioner().

0 commit comments

Comments
 (0)