You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Martin Grotzke (JIRA)" <ji...@apache.org> on 2017/05/28 21:17:04 UTC
[jira] [Updated] (KAFKA-5343) MockProducer should not handle
send/ProducerRecord after close
[ https://issues.apache.org/jira/browse/KAFKA-5343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grotzke updated KAFKA-5343:
----------------------------------
Description:
Currently {{MockProducer}} implements {{close}} with void, i.e. it just does nothing on {{close}}.
Assuming production code built for "max.in.flight.requests.per.connection=1" which transforms a list of events/records to several invocations of {{send(record, callback)}}, where the {{callback}} invokes {{close(0, MILLISECONDS)}} in case of an exception, the expectation is that after {{send}} failed for record R1, any record that was sent after R1 is *not* handled.
Similarly, in case of the {{MockProducer}}, the expectation is that any record after R1 is just ignored, and specifically neither autocompleted nor added to the list of completions.
This is not the case, because the {{MockProducer}} just ignores an invocation of {{close}}.
This fix should be trivial, does it makes sense to submit a PR for this?
was:
Currently {{MockProducer}} implements {{close}} with void, i.e. it just does nothing on {{close}}.
Assuming production code built for "max.in.flight.requests.per.connection=1" with transforms a list of events/records to several invocations of {{send(record, callback)}}, where the {{callback}} invokes {{close(0, MILLISECONDS)}} in case of an exception, the expectation is that after {{send}} failed for record R1, any record that was sent after R1 is *not* handled.
Similarly, in case of the {{MockProducer}}, the expectation is that any record after R1 is just ignored, and specifically neither autocompleted nor added to the list of completions.
This is not the case, because the {{MockProducer}} just ignores an invocation of {{close}}.
This fix should be trivial, does it makes sense to submit a PR for this?
> MockProducer should not handle send/ProducerRecord after close
> --------------------------------------------------------------
>
> Key: KAFKA-5343
> URL: https://issues.apache.org/jira/browse/KAFKA-5343
> Project: Kafka
> Issue Type: Improvement
> Components: producer
> Affects Versions: 0.10.2.1
> Reporter: Martin Grotzke
> Priority: Minor
>
> Currently {{MockProducer}} implements {{close}} with void, i.e. it just does nothing on {{close}}.
> Assuming production code built for "max.in.flight.requests.per.connection=1" which transforms a list of events/records to several invocations of {{send(record, callback)}}, where the {{callback}} invokes {{close(0, MILLISECONDS)}} in case of an exception, the expectation is that after {{send}} failed for record R1, any record that was sent after R1 is *not* handled.
> Similarly, in case of the {{MockProducer}}, the expectation is that any record after R1 is just ignored, and specifically neither autocompleted nor added to the list of completions.
> This is not the case, because the {{MockProducer}} just ignores an invocation of {{close}}.
> This fix should be trivial, does it makes sense to submit a PR for this?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)