java-operator-sdk icon indicating copy to clipboard operation
java-operator-sdk copied to clipboard

fix: fix lastAttempt value on first try when maxAttempt is zero

Open scrocquesel opened this issue 3 years ago • 0 comments

Fix https://github.com/java-operator-sdk/java-operator-sdk/issues/1395

I start adding enabled() on Retry interface but it feels wrong. Retry is a functional interface so it needs a default and neither true or false is a good choice. Moreover, implementation can wrongly implement it. For eg, return true while not returning at least one next delay.

Seems like ReconciliationDispatcher may call initExecution but if we don't want to create an instance only to test nextDelay result, it should be propagated up to the EventProcessor to be cached and I don't see how to do that.

scrocquesel avatar Aug 12 '22 21:08 scrocquesel