Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v23.3.x] kafka/client: Fix for stall during client shutdown #16392

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #16315
Fixes: #16391,

- During one of the audit log tests it was observed that the broker did
not shutdown.

- The logs demonstrated that producer::stop() had run to completion but
audit_log_manager::audit_client::shutdown() had not. The only
explaination would be the _gate within the audit_client holding up
shutdown, and that gate is only used on invoke to client::produce().
This means data is left in the buffer and producer::send() was never
called, which resolves outstanding promises.

- The kafka client waits to drain all data before shutdown, it does this
by calling produce_partition::stop() however this contains a conditional
that actually does nothing in the case _in_flight is true. This member
variable ensures only one call to send() can occur at a time. If stop()
does not drain the buffer then there will be leftover records to produce
and since stop() also cancels the producers timer, the records will
never be sent and the program will deadlock waiting for futures to
resolve that will never occur.

- The fix is to ensure that before stop() is called, _in_flight is
false. That way stop() will actually drain the buffers.

- Fixes: redpanda-data#16198

(cherry picked from commit e688c67)
@vbotbuildovich vbotbuildovich added this to the v23.3.x-next milestone Jan 31, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jan 31, 2024
@graphcareful graphcareful merged commit a37302c into redpanda-data:v23.3.x Feb 1, 2024
18 checks passed
@piyushredpanda piyushredpanda modified the milestones: v23.3.x-next, v23.3.5 Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants