You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2023/07/18 04:05:18 UTC
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #20823: [fix][broker] Fix direct memory leak by delayed index OutOfDirectMemory
poorbarcode commented on code in PR #20823:
URL: https://github.com/apache/pulsar/pull/20823#discussion_r1266184168
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java:
##########
@@ -1065,7 +1066,17 @@ public boolean trackDelayedDelivery(long ledgerId, long entryId, MessageMetadata
delayedDeliveryTracker.get().resetTickTime(topic.getDelayedDeliveryTickTimeMillis());
long deliverAtTime = msgMetadata.hasDeliverAtTime() ? msgMetadata.getDeliverAtTime() : -1L;
- return delayedDeliveryTracker.get().addMessage(ledgerId, entryId, deliverAtTime);
+ try {
+ return delayedDeliveryTracker.get().addMessage(ledgerId, entryId, deliverAtTime);
+ } catch (OutOfDirectMemoryError ex) {
Review Comment:
In general, the Error type is not recommended to catch, we should use these two ways to solve the problem
- Set the maximum memory usage of the delay message. If the delay message usage exceeds the maximum memory usage, stuck new read
- we should kill the process if the error occurs
--
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