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

Commits on Jan 31, 2024

  1. kafka/client: Fix for stall during client shutdown

    - 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)
    graphcareful authored and vbotbuildovich committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    3823027 View commit details
    Browse the repository at this point in the history