Skip to content

Commit

Permalink
Fixed the max backoff configuration for lookups (apache#6444)
Browse files Browse the repository at this point in the history
* Fixed the max backoff configuration for lookups

* Fixed test expectation

* More test fixes
  • Loading branch information
merlimat authored Mar 3, 2020
1 parent 459ec6e commit 6ff87ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public CompletableFuture<List<String>> getTopicsUnderNamespace(NamespaceName nam
Backoff backoff = new BackoffBuilder()
.setInitialTime(100, TimeUnit.MILLISECONDS)
.setMandatoryStop(opTimeoutMs.get() * 2, TimeUnit.MILLISECONDS)
.setMax(0, TimeUnit.MILLISECONDS)
.setMax(1, TimeUnit.MINUTES)
.create();
getTopicsUnderNamespace(serviceNameResolver.resolveHost(), namespace, backoff, opTimeoutMs, topicsFuture, mode);
return topicsFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public CompletableFuture<PartitionedTopicMetadata> getPartitionedTopicMetadata(S
Backoff backoff = new BackoffBuilder()
.setInitialTime(100, TimeUnit.MILLISECONDS)
.setMandatoryStop(opTimeoutMs.get() * 2, TimeUnit.MILLISECONDS)
.setMax(0, TimeUnit.MILLISECONDS)
.setMax(1, TimeUnit.MINUTES)
.create();
getPartitionedTopicMetadata(topicName, backoff, opTimeoutMs, metadataFuture);
} catch (IllegalArgumentException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testInboundConnection() throws Exception {
// OK
}
// should add retry count since retry every 100ms and operation timeout is set to 1000ms
Assert.assertEquals(ProxyService.rejectedConnections.get(), 11.0d);
Assert.assertEquals(ProxyService.rejectedConnections.get(), 5.0d);
}

private static final Logger LOG = LoggerFactory.getLogger(ProxyConnectionThrottlingTest.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void testLookup() throws Exception {
} catch (Exception ex) {
// Ignore
}
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 11.0d);
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 5.0d);
proxyService.getLookupRequestSemaphore().release();
try {
@Cleanup
Expand All @@ -106,6 +106,6 @@ public void testLookup() throws Exception {
Assert.fail("Should not have failed since can acquire LookupRequestSemaphore");
}

Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 11.0d);
Assert.assertEquals(LookupProxyHandler.rejectedPartitionsMetadataRequests.get(), 5.0d);
}
}

0 comments on commit 6ff87ee

Please sign in to comment.