Skip to content

Commit 56c7079

Browse files
merlimattuteng
authored andcommitted
Fixed the max backoff configuration for lookups (apache#6444)
* Fixed the max backoff configuration for lookups * Fixed test expectation * More test fixes (cherry picked from commit 6ff87ee)
1 parent 0afcf1b commit 56c7079

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public CompletableFuture<List<String>> getTopicsUnderNamespace(NamespaceName nam
213213
Backoff backoff = new BackoffBuilder()
214214
.setInitialTime(100, TimeUnit.MILLISECONDS)
215215
.setMandatoryStop(opTimeoutMs.get() * 2, TimeUnit.MILLISECONDS)
216-
.setMax(0, TimeUnit.MILLISECONDS)
216+
.setMax(1, TimeUnit.MINUTES)
217217
.create();
218218
getTopicsUnderNamespace(serviceNameResolver.resolveHost(), namespace, backoff, opTimeoutMs, topicsFuture, mode);
219219
return topicsFuture;

pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ public CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(S
663663
Backoff backoff = new BackoffBuilder()
664664
.setInitialTime(100, TimeUnit.MILLISECONDS)
665665
.setMandatoryStop(opTimeoutMs.get() * 2, TimeUnit.MILLISECONDS)
666-
.setMax(0, TimeUnit.MILLISECONDS)
666+
.setMax(1, TimeUnit.MINUTES)
667667
.create();
668668
getPartitionedTopicMetadata(topicName, backoff, opTimeoutMs, metadataFuture);
669669
} catch (IllegalArgumentException e) {

pulsar-proxy/src/test/java/org/apache/pulsar/proxy/server/ProxyConnectionThrottlingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void testInboundConnection() throws Exception {
100100
// OK
101101
}
102102
// should add retry count since retry every 100ms and operation timeout is set to 1000ms
103-
Assert.assertEquals(ProxyService.rejectedConnections.get(), 11.0d);
103+
Assert.assertEquals(ProxyService.rejectedConnections.get(), 5.0d);
104104
}
105105

106106
private static final Logger LOG = LoggerFactory.getLogger(ProxyConnectionThrottlingTest.class);

pulsar-proxy/src/test/java/org/apache/pulsar/proxy/server/ProxyLookupThrottlingTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void testLookup() throws Exception {
9696
} catch (Exception ex) {
9797
// Ignore
9898
}
99-
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 11.0d);
99+
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 5.0d);
100100
proxyService.getLookupRequestSemaphore().release();
101101
try {
102102
@Cleanup
@@ -106,6 +106,6 @@ public void testLookup() throws Exception {
106106
Assert.fail("Should not have failed since can acquire LookupRequestSemaphore");
107107
}
108108

109-
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 11.0d);
109+
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 5.0d);
110110
}
111111
}

0 commit comments

Comments
 (0)