Skip to content

Commit 779f526

Browse files
committed
add-max-retry-property-support
1 parent a254f02 commit 779f526

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public void onFailure(Throwable t) {
364364
computeNextBackoffDelayMs(outstandingBatch, retrySettings, longRandom);
365365

366366
if (!isRetryable(t)
367-
|| (retrySettings.getMaxAttempts() > 0 && outstandingBatch.getAttempt() > retrySettings.getMaxAttempts())
367+
|| retrySettings.getMaxAttempts() > 0 && outstandingBatch.getAttempt() > retrySettings.getMaxAttempts()
368368
|| System.currentTimeMillis() + nextBackoffDelay
369369
> outstandingBatch.creationTime
370370
+ retrySettings.getTotalTimeout().toMillis()) {

google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/spi/v1/PublisherImplTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,9 @@ public void testPublishFailureRetries_retriesDisabled() throws Exception {
298298
try {
299299
publishFuture1.get();
300300
} finally {
301-
assertTrue(testPublisherServiceImpl.getCapturedRequests().size() == 1);
301+
assertSame(testPublisherServiceImpl.getCapturedRequests().size(), 1);
302302
publisher.shutdown();
303303
}
304-
publisher.shutdown();
305304
}
306305

307306
@Test

0 commit comments

Comments
 (0)