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

Jay Kreps commented on KAFKA-1659:
----------------------------------

This makes sense, I think what you are asking for is the same thing described 
in your other JIRA, which is just the ability to force-close the producer 
(potentially after a period of time if the soft close doesn't work). This is a 
reasonable feature.

The other feature we could have that would perhaps accomplish the same thing is 
just to add a request timeout. I.e. if we see no activity on a socket with at 
least one outstanding request for X ms then we close the connection and 
consider the request failed. This prevents our blocking forever when the server 
fails with an outstanding request. If you had that then that would effectively 
act as a loose bound on the close time for the producer (since each request 
would either fail or complete in that time bound).

> Ability to cleanly abort the KafkaProducer
> ------------------------------------------
>
>                 Key: KAFKA-1659
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1659
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients, producer 
>    Affects Versions: 0.8.2
>            Reporter: Andrew Stein
>            Assignee: Jun Rao
>             Fix For: 0.8.2
>
>
> I would like the ability to "abort" the Java Client's KafkaProducer. This 
> includes the stopping the writing of buffered records.
> The motivation for this is described 
> [here|http://mail-archives.apache.org/mod_mbox/kafka-dev/201409.mbox/%3CCAOk4UxB7BJm6HSgLXrR01sksB2dOC3zdt0NHaKHz1EALR6%3DCTQ%40mail.gmail.com%3E].
> A sketch of this method is:
> {code}
> public void abort() {
>         try {
>             ioThread.interrupt();
>             ioThread.stop(new ThreadDeath());
>         } catch (IllegalAccessException e) {
>         }
> }
> {code}
> but of course it is preferable to stop the {{ioThread}} by cooperation, 
> rather than use the deprecated {{Thread.stop(new ThreadDeath())}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to