[ 
https://issues.apache.org/jira/browse/KAFKA-3720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17071749#comment-17071749
 ] 

Sönke Liebau commented on KAFKA-3720:
-------------------------------------

I read through the comments on the PR and would like to briefly summarize the 
current state here and propose a solution.

The current implementation throws a TimeoutException when no memory can be 
allocated for a record within max.block.ms - this exception is caught in the 
producer and returned from .send() in the Future object.

The metric _buffer-exhausted-records_ is currently unused.

A TimeoutException within .send() in the Producer can also be triggered by a 
failure to update Metadata, so is not a sufficient condition to update this 
metric. For that reason, the suggestion is to revive the 
BufferExhaustedException, which is currently unused.  We could make this 
exception extend TimeoutException so that existing code that listens for that 
exception continues to work and throw it instead of TimeoutException in 
BufferPool. This exception can then be caught in the Producer and used to 
trigger that metric.


An open question is whether this exception should be re-thrown in the producer, 
or returned in the Future. As this exception would be thrown in code that runs 
within max.block.ms a case could be made that this is still the synchroneous 
part of the send process and the exception should be thrown.

However, as the current implementation is to return the exception in the 
Future, I do not think we should change this without advance notice, as it has 
the potential to break user code.

[~mgharat] are you still willing to look at this? If not, I am happy to rebase 
the PR and re-create a new one..

> Remove BufferExhaustException from doSend() in KafkaProducer
> ------------------------------------------------------------
>
>                 Key: KAFKA-3720
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3720
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Mayuresh Gharat
>            Assignee: Mayuresh Gharat
>            Priority: Major
>
> KafkaProducer no longer throws BufferExhaustException. We should remove it 
> from the catch clause. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to