cjohnson-confluent opened a new pull request, #30247:
URL: https://github.com/apache/flink/pull/30247

   ## What is the purpose of the change
   
   After enough restart attempts, `ExponentialDelayRestartBackoffTimeStrategy` 
computes a backoff plus jitter that overflows `long`. The negative result is 
clamped to the initial backoff, so a job that keeps failing alternates between 
the initial and the max backoff instead of staying at the max. With 
jitter-factor 1.0, `offset + 1` overflows and `ThreadLocalRandom.nextLong` 
throws `IllegalArgumentException`.
   
   ## Brief change log
   
   - Saturate `currentBackoffTime + jitter` at `Long.MAX_VALUE` before clamping 
to the max backoff.
   - Use an exclusive upper bound of `offset` instead of `offset + 1` when the 
jitter offset is `Long.MAX_VALUE`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - `testBackoffStaysAtMaxAfterManyAttempts`: 200 attempts with initial 1 s, 
max 5 min, multiplier 2, jitter 0.1; from attempt 9 on the backoff must equal 
the max. Fails on master at attempt 53 (1000 instead of 300000).
   - `testFullJitterAfterManyAttempts`: same with jitter 1.0; the backoff must 
stay within [initial, max]. Throws `IllegalArgumentException` on master.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
   - The serializers: no
   - The runtime per-record code paths (performance sensitive): no
   - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes (restart backoff of 
the JobManager scheduler)
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Opus 5.5
   


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