lhotari commented on code in PR #24732:
URL: https://github.com/apache/pulsar/pull/24732#discussion_r2342144987
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/DrainingHashesTracker.java:
##########
@@ -397,6 +397,12 @@ public boolean shouldBlockStickyKeyHash(Consumer consumer,
int stickyKeyHash) {
lock.writeLock().lock();
try {
drainingHashes.remove(stickyKeyHash, entry);
+ // update the consumer specific stats
+ ConsumerDrainingHashesStats drainingHashesStats =
+ consumerDrainingHashesStatsMap.get(new
ConsumerIdentityWrapper(consumer));
+ if (drainingHashesStats != null) {
+ drainingHashesStats.clearHash(stickyKeyHash);
+ }
Review Comment:
It would be better to handle this after the writeLock has been release so
that possible deadlocks are avoided. That has been a bug pattern in the past.
--
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]