merlimat commented on code in PR #25657:
URL: https://github.com/apache/pulsar/pull/25657#discussion_r3178454348
##########
pulsar-client-api-v5/src/main/java/org/apache/pulsar/client/api/v5/config/BackoffPolicy.java:
##########
@@ -20,27 +20,55 @@
import java.time.Duration;
import java.util.Objects;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
/**
* Backoff configuration for broker reconnection attempts.
*
* <p>The delay for attempt {@code n} is {@code min(initialInterval *
multiplier^(n-1), maxInterval)}.
*
- * @param initialInterval the delay before the first reconnection attempt
- * @param maxInterval the maximum delay between reconnection attempts
- * @param multiplier the multiplier applied after each attempt
+ * <p>Use {@link #fixed(Duration, Duration)} or {@link #exponential(Duration,
Duration)} for
+ * the common cases, or {@link #builder()} to configure all knobs explicitly.
*/
-public record BackoffPolicy(
- Duration initialInterval,
- Duration maxInterval,
- double multiplier
-) {
- public BackoffPolicy {
+@EqualsAndHashCode
+@ToString
+public final class BackoffPolicy {
Review Comment:
Not really:
https://github.com/apache/pulsar/blob/77b05364f70811dc0dba13281fba68ac5a619478/pulsar-common/src/main/java/org/apache/pulsar/common/util/Backoff.java#L133-L138
It's hardcoded to 10% and, worse, it's not applied the first time, so all
first attempts are coming together
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]