...
- ProducerFencedException (Fatal)
- InvalidProducerEpochException (Non-fatal)
- KafkaException, which potentially wraps the following exceptions:
- IllegalStateException (Fatal)
- InvalidPidMappingException (Non-fatal)
- TransactionAbortedException (Non-fatal)
- ClusterAuthorizationException for idempotent send (Fatal)
- OutOfOrderSequenceException (Non-fatal)
- UnknownProducerIdException for producer state loss (Non-fatal)
- TransactionalIdAuthorizationException (Fatal)
- UnsupportedVersionException if transaction semantic is not supported (Fatal)
- AuthenticationException for transactional request authentication (Fatal)
- UnsupportedForMessageFormatException (Fatal)
- RuntimeException for detecting more than one inflight request, should be illegal state (Fatal)
- InvalidRecordException (Fatal)
- InvalidRequiredAcksException (Fatal)
- NotEnoughReplicasAfterAppendException (Non-fatal)
- NotEnoughReplicasException (Non-fatal)
- RecordBatchTooLargeException (Fatal)
- InvalidTopicException (Fatal)
- CorruptRecordException (Non-fatal)
- UnknownTopicOrPartitionException (Non-fatal)
- NotLeaderOrFollowerException (Non-fatal)
- GroupAuthorizationException (Fatal)
- KafkaException
- indicates retriable idempotent sequence (Non-fatal)
- indicates fatal transactional sequence (Fatal)
- indicates Producer closed (Fatal)
- InvalidTxnState (Fatal)
- unexpected reason (Fatal)
- TimeoutException for expired batch (Non-fatal)
As of 08/16/2022, we (guozhang Wang) made a pass inside the KafkaProducer on how we categorizes those exceptions, and also on how we wrapped those exceptions.
First of all, all exceptions are thrown from TransactionManager#maybeFailWithError, which is thrown from KafkaProducer#initTxn, #beginTxn, #commitTxn, #abortTxn, #sendOffsetsToTransaction, #send. Except #send, all other functions would trigger maybeFailWithError right at the beginning of the function call. However, KafkaProducer#send would only call this check AFTER the check
- Fatal :
- AuthenticationException. Thrown from maybeFailWithError
Proposed Changes
We are proposing a new transactional API usage template which makes EOS processing safer from handling a mix of fatal and non-fatal exceptions:
...