Versions Compared

Key

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

...

Currently if a transactional producer hits a fatal exception, the caller usually catches the exception and handle it by aborting invoking abortTransaction to abort the transaction by invoking abortTransaction, and then closing the the producer, which makes sense and sounds clean. The tricky scenario is that abortTransaction is not a safe call when the producer is already in an error state, which means user has to do another try-catch with the first layer catch block, making the error handling pretty annoying. It is more appropriate and user-friendly to ensure that the producer client does not throw the same exception again while aborting transaction.

...

Our proposal is quite straightforward and simple. To avoid throwing the same exception twice, we would remember whether a fatal exception has already been thrown to the application level, so that in abortTransaction we will not throw it again, thus making the function safe to be called in an error state.

...