poorbarcode commented on code in PR #23980:
URL: https://github.com/apache/pulsar/pull/23980#discussion_r1955482154
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1340,18 +1341,42 @@ private void
asyncDeleteCursorWithCleanCompactionLedger(PersistentSubscription s
return;
}
- currentCompaction.handle((__, e) -> {
- if (e != null) {
- log.warn("[{}][{}] Last compaction task failed", topic,
subscriptionName);
+ // Avoid concurrently execute compaction and unsubscribing.
+ synchronized (this) {
Review Comment:
Yes, it is. It prevents the modifying of the variable `currentCompaction`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]