You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2025/04/08 07:19:00 UTC
[jira] [Updated] (CAMEL-21940) KafkaProducerCallBack can execute the continuation twice
[ https://issues.apache.org/jira/browse/CAMEL-21940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-21940:
--------------------------------
Fix Version/s: 4.12.0
4.10.4
4.8.7
> KafkaProducerCallBack can execute the continuation twice
> --------------------------------------------------------
>
> Key: CAMEL-21940
> URL: https://issues.apache.org/jira/browse/CAMEL-21940
> Project: Camel
> Issue Type: Bug
> Components: camel-kafka
> Affects Versions: 4.8.6, 4.11.0
> Reporter: Pavel Borik
> Priority: Major
> Fix For: 4.12.0, 4.10.4, 4.8.7
>
>
> KafkaProducerCallback uses the following pattern with LongAdder to execute the continuation. This approach is not thread safe and thus it is possible the continuation is executed twice, once from the thread executing the onCompletion method and once from the thread executing the allSent method.
> {code:java}
> count.decrement();
> if (count.intValue() == 0) {
> ...
> callback.done()
> } {code}
> [https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/KafkaProducerCallBack.20can.20execute.20the.20continuation.20twice|http://example.com]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)