chickenchickenlove opened a new pull request, #20159:
URL: https://github.com/apache/kafka/pull/20159

   ### Changes
   - Add new Exception class `PotentialCauseException`. 
   - All `org.apache.kafka.common.errors.TimeoutException` in `KafkaProducer` 
has `PotentialCauseException` as  root cause if it cannot catch any exception. 
   
   ### Describe
   `TimeoutException` can be thrown for various reasons.
   However, it is often difficult to identify the root cause,
   Because there are so many potential factors that can lead to a 
`TimeoutException`.
   
   For example:
   1. The `ProducerClient` might be busy, so it may not be able to send the 
request in time. As a result, some batches may expire, leading to a 
`TimeoutException`.
   2. The `broker` might be unavailable due to network issues or internal 
failures.
   3. A request may be in flight, and although the broker successfully handles 
and responds to it, the response might arrive slightly late.
   
   As shown above, there are many possible causes.
   However, the developer using `TimeoutException` in `KafkaProducer` likely 
already knows which specific reasons could cause it in that context.
   Therefore, I think it would be helpful to include a 
`PotentialCauseException` that reflects the likely reason, based on the 
developer’s knowledge.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to