[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062064#comment-17062064 ] Guozhang Wang commented on KAFKA-5604: -- Verified that I've fixed the producer as in https://github.com/apache/kafka/pull/6171 (duh), will close this ticket as 2.3.0 now. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062058#comment-17062058 ] ASF GitHub Bot commented on KAFKA-5604: --- guozhangwang commented on pull request #8313: KAFKA-5604: Remove the redundant TODO marker on the Streams side URL: https://github.com/apache/kafka/pull/8313 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062008#comment-17062008 ] ASF GitHub Bot commented on KAFKA-5604: --- guozhangwang commented on pull request #8313: KAFKA-5604: Remove the redundant TODO marker on the Streams side URL: https://github.com/apache/kafka/pull/8313 The issue itself has been fixed a while ago on the producer side, so we can just remove this TODO marker now (we've removed the isZombie flag already anyways). ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17062006#comment-17062006 ] Guozhang Wang commented on KAFKA-5604: -- [~iamabug] There are some context missing from this comment: the abortTxn should only be called if there's still an in-flight txn during close, which means that the closing logic did not get triggered, which means that the task got some error state. However, in the past if a previous producer call (e.g. send, or sendOffsetsToTxn) get fenced with an exception, when calling abortTxn here we would not get the same fenced exception again but an IllegalStateException is thrown. I will file a quick PR to remove this on the Streams side to clear it up, so no worries here. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17061275#comment-17061275 ] Xiang Zhang commented on KAFKA-5604: Also, under that TODO marker, it says "this should actually never happen", I am confused by that because ProducerFencedException is always possible where two transactional instances exist at the same moment. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17061269#comment-17061269 ] Xiang Zhang commented on KAFKA-5604: [~guozhang] I believe there is still a TODO marker in [https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsProducer.java#L197] do we need to remove the TODO marker and submit a patch for this ticket ? > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17059481#comment-17059481 ] Guozhang Wang commented on KAFKA-5604: -- Thank you for looking into this, and I think your assessment is correct. We can close this ticket and you should just go ahead with 9592. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17058327#comment-17058327 ] Xiang Zhang commented on KAFKA-5604: [~mjsax] I notice that beginTransaction(), sendOffsesToTransaction(), commitTransaction(), abortTransaction() call maybeFailWithError() before anything. myabeFailWithError() is defined as : {code:java} private void maybeFailWithError() { if (hasError()) { // for ProducerFencedException, do not wrap it as a KafkaException // but create a new instance without the call trace since it was not thrown because of the current call if (lastError instanceof ProducerFencedException) { throw new ProducerFencedException("The producer has been rejected from the broker because " + "it tried to use an old epoch with the transactionalId"); } else { throw new KafkaException("Cannot execute transactional method because we are in an error state", lastError); } } } {code} [https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java#L1084] If lastError indeed tracks last error, it seems it will throw ProducerFencedException for the second time as expected. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (KAFKA-5604) All producer methods should raise `ProducerFencedException` after the first time.
[ https://issues.apache.org/jira/browse/KAFKA-5604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17053907#comment-17053907 ] Xiang Zhang commented on KAFKA-5604: [~apurva] I wonder if this ticket should be closed, https://issues.apache.org/jira/browse/KAFKA-9592# depends on this. > All producer methods should raise `ProducerFencedException` after the first > time. > - > > Key: KAFKA-5604 > URL: https://issues.apache.org/jira/browse/KAFKA-5604 > Project: Kafka > Issue Type: Bug >Reporter: Apurva Mehta >Assignee: Apurva Mehta >Priority: Major > > Currently, when a `ProducerFencedException` is raised from a transactional > producer, the expectation is that the application should call `close` > immediately. However, if the application calls other producer methods, they > would get a `KafkaException`. This is a bit confusing, and results in tickets > like : https://issues.apache.org/jira/browse/KAFKA-5603. > We should update the producer so that calls to any method other than `close` > should raise a `ProducerFencedException` after the first time it is raised. -- This message was sent by Atlassian Jira (v8.3.4#803005)