You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/20 14:01:59 UTC
[GitHub] [pulsar] eolivelli commented on pull request #13412: [Replication] Fix race condition in stopping replicator while it is starting
eolivelli commented on pull request #13412:
URL: https://github.com/apache/pulsar/pull/13412#issuecomment-997949961
the code in closeProducerAsync is still not correct
https://github.com/apache/pulsar/blob/a5830aebc6d53cb72875e86dd531a55d36575e98/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java#L160
because we are setting "producer" to null in a different thread.
every access o the "producer" field should be inside a `synchronized` block
we could move producer to a AtomicReference variable, or in any case we have to rework how we are accessing that variable.
alternatively it is better to assign a non-null value only once and never set the value back to null again
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org