Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As we know, the callback of `Producer#send` is executed by the `ioThread`. This design has led to caused numerous application bugs caused by calling when `Producer#flush` is called within the callback, resulting in deadlocks. Since `Producer#close` already includes logic to avoid blocking when invoked from a callback, we could implement similar logic for `Producer#flush`. This enhancement would help users avoid such pitfalls

Most importantly, in the current version of AK, invoking `Producer#flush` within the callback of `Producer#send` eventually leads to a timeout, which can be very confusing. With this enhancement, users will receive a clear message to understand what went wrong.

Public Interfaces

This KIP proposes two ways to implement this enhancement:

...