Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
Description
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.
while (deadline.hasTimeLeft()) {
doSomething(deadline.timeLeft());
}
All existing usage should be migrate to either
while (deadline.hasTimeLeft()) {
doSomething();
}
or
while (true) { doSomething(deadline.timeLeftIfAny()); }