Skip to content

Fix self-contradictory #commit_offsets description, clarify async Boolean semantics - #996

Merged
mensfeld merged 1 commit into
masterfrom
fix/offset-mgmt-commit-offsets-async-boolean-44164
Aug 12, 2026
Merged

Fix self-contradictory #commit_offsets description, clarify async Boolean semantics#996
mensfeld merged 1 commit into
masterfrom
fix/offset-mgmt-commit-offsets-async-boolean-44164

Conversation

@coipond-writer

Copy link
Copy Markdown
Contributor

What

`Consumer-Groups/Offset-management.md:70`'s `#commit_offsets` description was internally self-contradictory: "sends a request... but immediately gets confirmation. Instead, it returns immediately" -- these two clauses directly conflict (the second is only true if the first is false).

Investigation

`karafka/lib/karafka/connection/proxy.rb`'s `#commit_offsets` catches known synchronous errors (`assignment_lost`, `unknown_member_id`, `illegal_generation` -> `false`) but does not wait for broker acknowledgment when async, and `connection/client.rb`'s docstring notes this method "may return `true` despite involuntary partition revocation as it does not resolve to `lost_assignment?`."

So the Boolean return is available immediately (contrary to the ticket's initial "not immediately known" framing) -- but it only reflects the local commit request's state, not full broker confirmation or partition ownership. That means the page's `#revoked?` recommendation itself has real grounding, for that latter gap; the actual bug was the contradictory phrasing, not the substance of the recommendation.

Fix

Rewrote the paragraph to remove the contradiction and describe accurately what the returned Boolean does and does not tell you.

Fixes #44164 (Redmine, confidence: likely -- independently re-investigated in depth before fixing, since the original finding's framing did not fully hold up).

…lean semantics

The prose was internally self-contradictory: "sends a request... but
immediately gets confirmation. Instead, it returns immediately" -
these two clauses directly conflict.

Also verified the underlying claim: karafka/lib/karafka/connection/proxy.rb's
#commit_offsets catches known synchronous errors (assignment_lost,
unknown_member_id, illegal_generation -> false) but does not wait for
broker acknowledgment when async, and client.rb's docstring notes this
method "may return true despite involuntary partition revocation as it
does not resolve to lost_assignment?". So the Boolean return IS
available immediately, but it only reflects the local commit request
state, not full broker confirmation or partition ownership - the
#revoked? recommendation itself has real grounding for that latter gap.

Rewrote the paragraph to fix the contradiction and describe accurately
what the returned Boolean does and does not tell you.

Fixes #44164.
@mensfeld
mensfeld merged commit 11e5c67 into master Aug 12, 2026
4 checks passed
@mensfeld
mensfeld deleted the fix/offset-mgmt-commit-offsets-async-boolean-44164 branch August 12, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant