Skip to content

fix(client): break brod_client <-> producers_sup deadlock - #665

Merged
zmstone merged 2 commits into
kafka4beam:masterfrom
zmstone:260611-fix-client-producers-sup-deadlock
Jun 13, 2026
Merged

fix(client): break brod_client <-> producers_sup deadlock#665
zmstone merged 2 commits into
kafka4beam:masterfrom
zmstone:260611-fix-client-producers-sup-deadlock

Conversation

@zmstone

@zmstone zmstone commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

fixes #662

@zmstone
zmstone force-pushed the 260611-fix-client-producers-sup-deadlock branch from 62af618 to cbb72fc Compare June 11, 2026 14:55
Comment thread src/brod_producers_sup.erl Outdated
Comment on lines +184 to +185
%% Fall back to the synchronous brod_client API on cache miss to preserve
%% behaviour for any external caller of `start_producer/4'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I understand this remark and fallback.

could you please expand on it? i.e., how would this affect an external caller if it starts a child the normal way, in which case it is supposed to hit the cache according to the comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new commit refined this comment.

…ires

Spell out that the cache lookup is guaranteed to hit on every
brod_client-driven path (validate_topic_existence/3 populates the
entry, and positive entries have no TTL/eviction), so the synchronous
fallback is only reached by external callers of start_producer/4 —
who retain the pre-fix deadlock risk against a concurrent brod_client
metadata refresh.
@zmstone
zmstone force-pushed the 260611-fix-client-producers-sup-deadlock branch from 749aa00 to e76a400 Compare June 11, 2026 19:15
@zmstone
zmstone merged commit 5d70908 into kafka4beam:master Jun 13, 2026
10 checks passed
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.

Deadlock between brod_client and brod_producers_sup, especially since 4.4.5

2 participants