1991santhu commented on PR #11654:
URL: https://github.com/apache/seatunnel/pull/11654#issuecomment-5183575495

   Correcting my own patch before review time goes into it.
   
   The first revision used equal jitter, returning a value in `[wait/2, wait]`. 
Since this backoff fires specifically on HTTP 429, halving it means retrying a 
rate-limited API **sooner** than `rateLimitBackoffMs` was configured for — 
which works against the purpose of the setting.
   
   The jitter is now added rather than centred:
   
   ```java
   long extra = Math.min(waitMillis, MAX_BACKOFF_MILLIS - waitMillis);
   if (extra <= 0) {
       return waitMillis;
   }
   return waitMillis + ThreadLocalRandom.current().nextLong(extra + 1);
   ```
   
   so the result is in `[wait, min(2*wait, MAX_BACKOFF_MILLIS)]` — never 
shorter than configured, still capped.
   
   Decorrelation is unaffected: what matters is that clients differ from one 
another, not which direction they differ in.
   
   Tests updated to assert the new bounds. `mvn test -pl 
seatunnel-connectors-v2/connector-http/connector-http-airtable` still passes 
9/9, with the pre-existing 429 tests unmodified.
   


-- 
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]

Reply via email to