You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2025/09/16 04:31:30 UTC
(pulsar) branch branch-3.3 updated (37effb80508 -> 6e147172130)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a change to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
from 37effb80508 [fix][broker] Fix cannot shutdown broker gracefully by admin api (#24731)
new 74e7474cbc9 [improve][build] Upgrade Apache Parent POM to version 35 (#24742)
new 6e147172130 [fix][client] Fix receiver queue auto-scale without memory limit (#24743)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
build/run_unit_group.sh | 2 +-
buildtools/pom.xml | 2 +-
pom.xml | 2 +-
pulsar-bom/pom.xml | 2 +-
.../impl/AutoScaledReceiverQueueSizeTest.java | 34 ++++++++++++++++++++++
.../pulsar/client/impl/MemoryLimitController.java | 3 ++
.../client/impl/MemoryLimitControllerTest.java | 7 +++++
7 files changed, 48 insertions(+), 4 deletions(-)
(pulsar) 01/02: [improve][build] Upgrade Apache Parent POM to version 35 (#24742)
Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 74e7474cbc916dffa3030c641f7720203e1b10a4
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Tue Sep 16 06:23:56 2025 +0300
[improve][build] Upgrade Apache Parent POM to version 35 (#24742)
(cherry picked from commit 831740ccc6d2fe3257ab0188ea5f935669142bb8)
---
build/run_unit_group.sh | 2 +-
buildtools/pom.xml | 2 +-
pom.xml | 2 +-
pulsar-bom/pom.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/build/run_unit_group.sh b/build/run_unit_group.sh
index 40f83efaf2f..02347648b94 100755
--- a/build/run_unit_group.sh
+++ b/build/run_unit_group.sh
@@ -171,7 +171,7 @@ function test_group_proxy() {
function test_group_other() {
mvn_test --clean --install \
- -pl '!org.apache.pulsar:distribution,!org.apache.pulsar:pulsar-offloader-distribution,!org.apache.pulsar:pulsar-server-distribution,!org.apache.pulsar:pulsar-io-distribution,!org.apache.pulsar:pulsar-all-docker-image' \
+ -pl '!org.apache.pulsar:distribution,!org.apache.pulsar:pulsar-offloader-distribution,!org.apache.pulsar:pulsar-server-distribution,!org.apache.pulsar:pulsar-io-distribution,!org.apache.pulsar:pulsar-docker-image,!org.apache.pulsar:pulsar-all-docker-image' \
-PskipTestsForUnitGroupOther -DdisableIoMainProfile=true -DskipIntegrationTests \
-Dexclude='**/ManagedLedgerTest.java,
**/OffloadersCacheTest.java
diff --git a/buildtools/pom.xml b/buildtools/pom.xml
index d27752df00b..dbb0c480d4e 100644
--- a/buildtools/pom.xml
+++ b/buildtools/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
- <version>29</version>
+ <version>35</version>
<relativePath />
</parent>
diff --git a/pom.xml b/pom.xml
index 10c83ecb914..65822138361 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
- <version>29</version>
+ <version>35</version>
</parent>
<groupId>org.apache.pulsar</groupId>
diff --git a/pulsar-bom/pom.xml b/pulsar-bom/pom.xml
index d566a1c89a6..05853e4f4fa 100644
--- a/pulsar-bom/pom.xml
+++ b/pulsar-bom/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
- <version>29</version>
+ <version>35</version>
<relativePath/>
</parent>
(pulsar) 02/02: [fix][client] Fix receiver queue auto-scale without memory limit (#24743)
Posted by lh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 6e147172130ee97ae8fddb7a89cdea26c70eb36c
Author: Philipp Dolif <52...@users.noreply.github.com>
AuthorDate: Tue Sep 16 05:30:58 2025 +0200
[fix][client] Fix receiver queue auto-scale without memory limit (#24743)
(cherry picked from commit 8e35e34350866e150220872e1ed6a5c7009a43e2)
---
.../impl/AutoScaledReceiverQueueSizeTest.java | 34 ++++++++++++++++++++++
.../pulsar/client/impl/MemoryLimitController.java | 3 ++
.../client/impl/MemoryLimitControllerTest.java | 7 +++++
3 files changed, 44 insertions(+)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
index 2fefc7f13f9..ac3d5488995 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
@@ -33,7 +33,9 @@ import org.apache.pulsar.client.api.BatchReceivePolicy;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.Producer;
+import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
+import org.apache.pulsar.client.api.SizeUnit;
import org.apache.pulsar.client.api.SubscriptionInitialPosition;
import org.apache.pulsar.common.util.FutureUtil;
import org.awaitility.Awaitility;
@@ -319,4 +321,36 @@ public class AutoScaledReceiverQueueSizeTest extends MockedPulsarServiceBaseTest
Assert.assertEquals(controller.currentUsage(), 0);
Assert.assertEquals(controller.currentUsagePercent(), 0);
}
+
+ @Test
+ public void testWithoutMemoryLimit() throws PulsarClientException {
+ @Cleanup
+ PulsarClient clientWithoutMemoryLimit = PulsarClient.builder()
+ .memoryLimit(0, SizeUnit.BYTES)
+ .serviceUrl(pulsar.getBrokerServiceUrl())
+ .build();
+
+ String topic = "persistent://public/default/testWithoutMemoryLimit";
+ @Cleanup
+ ConsumerImpl<byte[]> consumer = (ConsumerImpl<byte[]>) clientWithoutMemoryLimit.newConsumer()
+ .topic(topic)
+ .subscriptionName("my-sub")
+ .receiverQueueSize(3)
+ .autoScaledReceiverQueueSizeEnabled(true)
+ .subscribe();
+ Assert.assertEquals(consumer.getCurrentReceiverQueueSize(), 1);
+
+ @Cleanup
+ Producer<byte[]> producer = pulsarClient.newProducer().topic(topic).enableBatching(false).create();
+ byte[] data = "data".getBytes(StandardCharsets.UTF_8);
+
+ producer.send(data);
+ Awaitility.await().until(consumer.scaleReceiverQueueHint::get);
+ Assert.assertNotNull(consumer.receive());
+
+ // this will trigger a receiver queue size expansion
+ Assert.assertNull(consumer.receive(0, TimeUnit.MILLISECONDS));
+
+ Assert.assertEquals(consumer.getCurrentReceiverQueueSize(), 2);
+ }
}
diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MemoryLimitController.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MemoryLimitController.java
index c15821c0543..19f56cf98cb 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MemoryLimitController.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MemoryLimitController.java
@@ -139,6 +139,9 @@ public class MemoryLimitController {
}
public double currentUsagePercent() {
+ if (!isMemoryLimited()) {
+ return 0.0;
+ }
return 1.0 * currentUsage.get() / memoryLimit;
}
diff --git a/pulsar-client/src/test/java/org/apache/pulsar/client/impl/MemoryLimitControllerTest.java b/pulsar-client/src/test/java/org/apache/pulsar/client/impl/MemoryLimitControllerTest.java
index 1aaf3f77da4..027479511dd 100644
--- a/pulsar-client/src/test/java/org/apache/pulsar/client/impl/MemoryLimitControllerTest.java
+++ b/pulsar-client/src/test/java/org/apache/pulsar/client/impl/MemoryLimitControllerTest.java
@@ -49,6 +49,7 @@ public class MemoryLimitControllerTest {
@Test
public void testLimit() throws Exception {
MemoryLimitController mlc = new MemoryLimitController(100);
+ assertTrue(mlc.isMemoryLimited());
for (int i = 0; i < 101; i++) {
mlc.reserveMemory(1);
@@ -75,6 +76,12 @@ public class MemoryLimitControllerTest {
mlc.releaseMemory(50);
assertTrue(mlc.tryReserveMemory(1));
assertEquals(mlc.currentUsagePercent(), 1.01);
+
+ MemoryLimitController mlcNoLimit = new MemoryLimitController(0);
+ assertFalse(mlcNoLimit.isMemoryLimited());
+ assertEquals(mlcNoLimit.currentUsagePercent(), 0.0);
+ assertTrue(mlcNoLimit.tryReserveMemory(1));
+ assertEquals(mlcNoLimit.currentUsagePercent(), 0.0);
}
@Test