You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yun Gao (Jira)" <ji...@apache.org> on 2022/04/13 06:28:05 UTC
[jira] [Updated] (FLINK-15740) Remove Deadline#timeLeft()
[ https://issues.apache.org/jira/browse/FLINK-15740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yun Gao updated FLINK-15740:
----------------------------
Fix Version/s: 1.16.0
> Remove Deadline#timeLeft()
> --------------------------
>
> Key: FLINK-15740
> URL: https://issues.apache.org/jira/browse/FLINK-15740
> Project: Flink
> Issue Type: Improvement
> Components: API / DataStream, Tests
> Reporter: Chesnay Schepler
> Priority: Minor
> Labels: auto-deprioritized-major, pull-request-available
> Fix For: 1.15.0, 1.16.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> As shown in FLINK-13662, {{Deadline#timeLeft()}} is conceptually broken since there is no reliable way to call said method while ensuring that
> a) the value is non-negative (desired since most time-based APIs reject negative values)
> b) the value sign (+,-) corresponds to preceding calls to {{#hasTimeLeft()}}
>
> As a result any usage of the following form is unreliable and obfuscating error messages.
> {code:java}
> while (deadline.hasTimeLeft()) {
> doSomething(deadline.timeLeft());
> } {code}
>
> All existing usage should be migrate to either
> {code:java}
> while (deadline.hasTimeLeft()) {
> doSomething();
> } {code}
> or
> {code:java}
> while (true) {
> doSomething(deadline.timeLeftIfAny());
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)