Versions Compared

Key

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

...

Cross Exception handling doesn't match as mentioned in KIP-691

RetriableException

Exception/Error Names

Current handling

New Handling


Producer API

Transaction API

Producer API

Transaction API

Comments

CorruptRecordException

NotEnoughReplicasAfterAppendException

NotEnoughReplicasException

TimeoutException

Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Producer Retriable Image Modified

Producer Retriable Image Modified


ConcurrentTransactionsException

Retriable

Retriable

Producer Retriable (KIP-890 may see this)

Producer Retriable


CoordinatorLoadInProgressException

Retriable

Retriable

Producer Retriable

Producer Retriable


RefreshRetriableException

Exception/Error Names

Current handling

New Handling


Producer API

Transaction API

Producer API

Transaction API

Comments

UnknownTopicOrPartitionException

NotLeaderOrFollowerException

Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Refresh + Retriable Image Modified

Refresh + Retriable Image Modified

Both UnknownTopicOrPartitionException and NotLeaderOrFollowerException  extends AuthorizationException 


Current class hierarchy in code is:

UnknownTopicOrPartitionException < RetriableException < ApiException



New class hierarchy in code will be:

UnknownTopicOrPartitionException < RefreshRetriableException < RetriableException < ApiException

NotCoordinatorException

CoordinatorNotAvailableException

Retriable

Retriable

Refresh + Retriable

Refresh + Retriable


TransactionAbortableException

Exception/Error Names

Current handling

New Handling



Producer API

Transaction API

Producer API

Transaction API

Comments

TransactionAbortableException
** note – Added via KIP-890

Producer Abortable

Producer Abortable

Producer Abortable

Producer Abortable


ApplicationRecoverableException

Exception/Error Names

Current handling

New Handling



Producer API

Transaction API

Producer API

Transaction API

Comments

InvalidProducerEpochException

IllegalStateException

Abortable

Fatal

Application Recoverable Image Removed

Application Recoverable Image Removed

ProducerFencedException

Fatal

Fatal

Application Recoverable

Sometimes Fatal depending on whether application or Sender caused issue. See: kafka: KAFKA-14831: Illegal state errors should be fatal in transactional producerCLOSED

Application Recoverable (probably not expected) Image Modified

Application RecoverableImage Modified

InvalidPidMappingException

Sometimes retriable (no longer returned) or abortable

Abortable

Application Recoverable


We will handle all default exceptions as generic unknown errors, which will be application recoverable


KafkaException

Abortable (default seems to be abortable)

Fatal in most cases, but abortable when there are partition errors

Application Recoverable (not expected) Image Modified

Application Recoverable (not expected) Image Modified

FencedInstanceIdException

CommitFailedException

UnknownMemberIdException

IllegalGenerationExceiption

N/A

Exception/Error Names

Current handling

New Handling

Producer API

Transaction API

Producer API

Transaction API

IllegalStateException

Abortable

Sometimes Fatal depending on whether application or Sender caused issue. See: kafka: KAFKA-14831: Illegal state errors should be fatal in transactional producerCLOSED

Application Recoverable (probably not expected)

RuntimeException

Abortable (

TxnOffsetCommit Only)

N/A

Application Recoverable Image Removed

CorrelationIdMismatchException

Application Recoverable

Application Recoverable

We will handle all default exceptions as generic unknown errors, which will be application recoverable. Below are few such exceptions:

default seems to be abortable)

Fatal – only thrown as this generic type when correlation ID is wrong. This should be updated as KIP-691 suggests

Application Recoverable (not expected) Image Added

Application Recoverable (not expected) Image Added

InvalidProducerEpochException

Abortable

Fatal

Application Recoverable Image Added

Application Recoverable Image Added


ProducerFencedException

Fatal

Fatal

Application Recoverable

Image Modified

Application Recoverable Image Modified

KafkaExceptionApplication Recoverable (not expected)


InvalidPidMappingException

Abortable (default seems to be abortable)

Fatal in most cases, but abortable when there are partition errors

Sometimes retriable (no longer returned) or abortable

Abortable

Application Recoverable

Image Modified

Application Recoverable

(not expected) Image RemovedRuntimeException

Image Added


FencedInstanceIdException

CommitFailedException

UnknownMemberIdException

IllegalGenerationExceiption

N/A

Abortable (

default seems to be abortable)

Fatal – only thrown as this generic type when correlation ID is wrong. This should be updated as KIP-691 suggests

Application Recoverable (not expected) Image Removed

Application Recoverable (not expected) Image Removed

InvalidTxnStateException requires special handling where producer API and Transactional API has different handling:

TxnOffsetCommit Only)

N/A

Application Recoverable Image Added

CommitFailedException extends KafkaException is default exception handled as Application Recoverable. This class will not be extended by ApplicationRecoverableException

CorrelationIdMismatchException



Application Recoverable

Application Recoverable

CorrelationIdMismatchException extends IllegalStateException which is default exception handled as Application Recoverable. This class will not be extended by ApplicationRecoverableException

Exception/Error Names

Current handling

Expected Handling

Producer API

Transaction API

Producer API

Transaction API

InvalidTxnStateException

Abortable

Fatal

Producer Abortable (KIP-890 relies on this – note this is the only one that differs with Produce API) Image Modified

Application Recoverable Image Modified

InvalidTxnStateException requires special handling where producer API and Transactional API has different handling


InvalidConfigurationException

Exception/Error Names

Current handling

Expected Handling


Producer API

Transaction API

Producer API

Transaction API

Comments

AuthenticationException

Abortable

Fatal

Invalid Configuration Image Modified

Invalid Configuration (not expected) Image Modified


ClusterAuthorizationException

TransactionalIdAuthorizationException

UnsupportedVersionException

UnsupportedForMessageFormatException

Fatal, except UnsupportedForMessageFormatException which is Abortable

Cluster/Transaction Auth → abortable on InitProducerId, other errors abortable

TransactionAuth → fatal, others abortable for AddPartitions, Find Coordinator, EndTxn, AddOffsets

Transaction Auth, UnssupportedForMessageFormat → fatal for OffsetCommit

Invalid Configuration Image Modified

Invalid Configuration Image Modified


InvalidRecordException

InvalidRequiredAcksException

RecordBatchTooLargeException

InvalidTopicException

Retriable if the error is retriable. Otherwise abortable

Retriable if the error is retriable otherwise abortable

Invalid Configuration Image Modified

Invalid Configuration Image Modified


TopicAuthorizationException

GroupAuthorizationException

Abortable

Abortable

Invalid Configuration Image Modified

Invalid Configuration Image Modified

Both TopicAuthorizationException and GroupAuthorizationException extends AuthorizationException 


Current class hierarchy in code is:

TopicAuthorizationException < AuthorizationException < ApiException

New class hierarchy in code will be TopicAuthorizationException < AuthorizationException < InvalidConfigurationException < ApiException`


Public Interfaces

We have below exception classes available in current Kafka code

...