MartijnVisser opened a new pull request, #29039:
URL: https://github.com/apache/flink/pull/29039

   ## What is the purpose of the change
   
   Resolves FLINK-40503 by documenting when `withIdleness` actually takes 
effect. The `WatermarksWithIdleness` countdown is anchored at the first quiet 
periodic probe rather than at the last record, and the strict `>` comparison 
only fires at the next probe after the timeout is exceeded — so idleness is 
detected between idleTimeout and idleTimeout plus three watermark intervals 
after the last record (the worst case is attained when the timeout is an exact 
multiple of the auto-watermark interval). The javadoc previously implied 
detection at idleTimeout. The timing itself is intentionally left unchanged: 
silently changing detection timing in this area has a regression track record 
(cf. the FLIP-471 follow-ups).
   
   ## Brief change log
   
   - Clarified the `WatermarkStrategy#withIdleness` javadoc and the 
`WatermarksWithIdleness` class doc with the precise detection-timing contract.
   - Added an equivalent paragraph to the "Dealing With Idle Sources" section 
of the event-time documentation (English page; updating the Chinese translation 
is a follow-up).
   - Added `WatermarksWithIdlenessTimeoutTest`, pinning the documented timing 
deterministically with a manual clock (timeout 10ms, probes every 5ms: not idle 
at the probes 11ms and 16ms after the last event, idle at the probe 21ms after 
it).
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - New deterministic `WatermarksWithIdlenessTimeoutTest` pins the documented 
detection timing.
   - Existing `WatermarksWithIdlenessTest` and `WatermarkStrategyTest` pass 
unchanged; no existing tests were modified.
   - Otherwise documentation-only; no behavior change.
   
   ## 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 (javadoc-only changes on 
`WatermarkStrategy`/`WatermarksWithIdleness`)
     - 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: no
     - 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 (clarifies 
existing documentation)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Fable 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