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 2020/01/31 19:44:42 UTC
[GitHub] [pulsar] merlimat commented on a change in pull request #6178:
Introduce maxMessagePublishBufferSizeInMB configuration to avoid broker OOM
merlimat commented on a change in pull request #6178: Introduce maxMessagePublishBufferSizeInMB configuration to avoid broker OOM
URL: https://github.com/apache/pulsar/pull/6178#discussion_r373653835
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -2009,4 +2025,49 @@ public ConfigField(Field field) {
return Optional.empty();
}
}
+
+ private void enableTopicsAutoRead() {
+ topics.values().forEach(future -> {
+ if (future.isDone() && !future.isCompletedExceptionally()) {
+ try {
+ future.get().ifPresent(Topic::enableProducerRead);
+ } catch (InterruptedException | ExecutionException e) {
+ // no-op
+ }
+ }
+ });
+ }
+
+ @VisibleForTesting
+ boolean increasePublishBufferSizeAndCheckStopRead(int msgSize) {
+ if (maxMessagePublishBufferSize < 0) {
+ return false;
+ }
+ if (currentMessagePublishBufferSize.addAndGet(msgSize) >= maxMessagePublishBufferSize &&
Review comment:
This would become a contention point across all the threads in the broker
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services