Skip to content

feature: controller reconciliation max delay - #871

Merged
csviri merged 13 commits into
mainfrom
max-delay
Jan 31, 2022
Merged

csviri merged 13 commits into
mainfrom
max-delay

Conversation

@csviri

@csviri csviri commented Jan 26, 2022

Copy link
Copy Markdown
Collaborator

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

@andreaTP andreaTP left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread docs/documentation/features.md Resolved
Comment thread docs/documentation/features.md Resolved
Comment thread docs/documentation/features.md Resolved
return ResourceEventFilters.passthrough();
}

default long reconciliationMaxInterval() {

Copy link
Copy Markdown
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
Copy Markdown
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.

@csviri csviri Jan 28, 2022 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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
Copy Markdown
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.

@csviri csviri Jan 28, 2022 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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....

@metacosm metacosm Jan 28, 2022 •

Copy link
Copy Markdown
Collaborator

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
csviri requested a review from metacosm January 28, 2022 14:51
Comment thread docs/documentation/features.md Outdated
the standard annotation:

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

Copy link
Copy Markdown
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.

@metacosm metacosm left a comment

Copy link
Copy Markdown
Collaborator

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
@sonarqubecloud

Copy link
Copy Markdown

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

@metacosm metacosm left a comment

Copy link
Copy Markdown
Collaborator

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