Skip to content

Async producer should wait for messages to flush before closing #477

@santosh-d3vpl3x

Description

@santosh-d3vpl3x

As per code in base.py, a shutdown method is registered with atexit.register(cleanup, self) statement. This registered method does not pass any timeout effectively causing data loss. Producer.close with custom timeout value works properly but most of the time when application receives exit signal, _run_exitfuncs calls close on producer before any other close call with set timeout..

We should allow users to set custom value of timeout in registered cleanup method allowing data to flush in Kafka or if we can wait for queue to drain then that would be most efficient approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions