Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: controller reconciliation max delay #871

Merged
merged 13 commits into from
Jan 31, 2022
Merged

feature: controller reconciliation max delay #871

merged 13 commits into from
Jan 31, 2022

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Jan 26, 2022

No description provided.

@csviri csviri self-assigned this Jan 26, 2022
@csviri csviri marked this pull request as ready for review January 26, 2022 15:11
@csviri csviri requested a review from metacosm January 26, 2022 15:11
Copy link
Collaborator

@andreaTP andreaTP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

docs/documentation/features.md Outdated Show resolved Hide resolved
docs/documentation/features.md Outdated Show resolved Hide resolved
docs/documentation/features.md Outdated Show resolved Hide resolved
@@ -114,4 +115,12 @@ default boolean useFinalizer() {
default ResourceEventFilter<R> getEventFilter() {
return ResourceEventFilters.passthrough();
}

default long reconciliationMaxInterval() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better to introduce a separate annotation if we split the duration and its unit to make the name simpler and make it more coherent because it doesn't make sense to provide one without the other.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little worried that it would unnecessary complicate things; also there is always a default value. Also both start with same prefix, I don't think this will be confusing.

Copy link
Collaborator Author

@csviri csviri Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is to have the time as a string, like "10h" or "140m". But we use this separation in other API already.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it would complicate things and it would make things cleaner to group related things in a single part. Otherwise, you could have annotated reconcilers with just reconciliationMaxIntervalTimeUnit and that would look really weird. Currently, the only hint that these things are related are their names. It's better to make it explicit, in my opinion. It also avoids polluting the main configuration with things that will rarely be used. Embedding the unit in the String is a recipe for disaster, imo, and I think it's much cleaner to separate the configuration into a separate annotation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just to see it clear. The reason to separate this into a new annotation because there are two related fields?
I'm not sure that makes the effort, especially since we everything in one (for now mandatory) annotation what is a good thing.
We would like to have this feature by default turned on, so what if that annotation is not present? Actually I guess should be turned off? It's easy to miss that it even exists.

Copy link
Collaborator Author

@csviri csviri Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the best would be to ask the users. @andreaTP @lburgazzoli what do you think, should be this a separate annotation or not?

see also the issue:
#848

Thank you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace control is done that way. Pretty much all the annotation fields have default values so we already turn things on without the annotation being present. This would be the exact same thing here: the child annotation would just allow people to change the default value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, I'm not saying we should have a completely separate annotation, just a composite child annotation for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, I'm not saying we should have a completely separate annotation, just a composite child annotation for this.

Ahhh, ok that is a completely different story! Sure that makes sense! Sorry....

Copy link
Collaborator

@metacosm metacosm Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only understood that I hadn't been clear enough with what I was saying with your last comment :)
Sorry! 😓

csviri and others added 3 commits January 28, 2022 10:34
@csviri csviri requested a review from metacosm January 28, 2022 14:51
the standard annotation:

```java
@ControllerConfiguration(finalizerName = NO_FINALIZER, reconciliationMaxInterval = 2L,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated.

Copy link
Collaborator

@metacosm metacosm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart the doc that needs to be updated. I might open a subsequent PR to mirror the annotation split in the configuration itself later.

@csviri csviri requested a review from metacosm January 31, 2022 12:55
@sonarcloud
Copy link

sonarcloud bot commented Jan 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

23.8% 23.8% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@metacosm metacosm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner, I like it! 👍🏼

@csviri csviri merged commit 7658e31 into main Jan 31, 2022
@csviri csviri deleted the max-delay branch January 31, 2022 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Periodic Reconciliation - Able to Set Max Interval Between Reconciliations
3 participants