Skip to content

chore: sync main-4.1 (4.1.11) into main - #120

Merged
zmstone merged 4 commits into
kafka4beam:mainfrom
zmstone:260723-sync-main-4.1
Jul 23, 2026
Merged

chore: sync main-4.1 (4.1.11) into main#120
zmstone merged 4 commits into
kafka4beam:mainfrom
zmstone:260723-sync-main-4.1

Conversation

@zmstone

@zmstone zmstone commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Merge main-4.1 into main, bringing the 4.1.11 release (memory-mode pop-linger, #119) forward.

Conflict resolutions

  • src/wolff_producer.erl: maybe_send_to_kafka — combined both sides: the function keeps main's drop_expired_head/1 call (from max_batch_age, feat: add max_batch_age to drop stale batches instead of retrying #117) and gains the Linger argument from 4.1.11. Expired batches are shed before the pop-linger gate, so the gate's replayq:bytes/1 threshold check never counts already-expired data.
  • changelog.md: kept both entries — unreleased 4.2.0 on top, released 4.1.11 below it.

Everything else auto-merged; the linger gate call-site set is unchanged (no new maybe_send_to_kafka callers were introduced by #117/#118).

Verified on the merge result: 67 eunit tests (both branches' suites), 11 CT cases, dialyzer, xref — all pass.

zmstone added 4 commits July 23, 2026 18:03
Since 4.1.1, the linger delay was applied only before enqueue, and only
when replayq is writing to disk (to batch disk writes).  Memory-mode
producers therefore sent each arrival immediately, resulting in many
small produce requests under steady low-to-moderate load.

Now, when it is time to form a new produce request and the queue holds
less than min(max_linger_bytes, max_batch_bytes) bytes, the producer
waits up to max_linger_ms for more calls to accumulate before popping
the queue.  The wait ends as soon as a full batch worth of bytes is
queued, so under sustained load full batches are sent with no added
latency; only under-sized (tail) batches are delayed, bounded by
max_linger_ms.

The default max_linger_ms = 0 keeps the previous behavior.
…ry-mode

fix: apply max_linger_ms to memory-mode queues (linger before pop)
# Conflicts:
#	changelog.md
#	src/wolff_producer.erl
@zmstone
zmstone merged commit 99a2fd1 into kafka4beam:main Jul 23, 2026
4 checks passed
@zmstone
zmstone deleted the 260723-sync-main-4.1 branch July 23, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant