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

Grace period for diff #70

Merged
merged 4 commits into from
Jul 12, 2022
Merged

Grace period for diff #70

merged 4 commits into from
Jul 12, 2022

Conversation

ties
Copy link
Collaborator

@ties ties commented Jul 11, 2022

When a VRP disappears from one input it may not disappear from the other input at the same time. Because a VRP is not present in one input, that has been present in the other input for a long time, an alert may fire immediately if the other source does not get updated before that alert fires.

This commits adds a grace period during which elements that disappear from one source do not cause alerts (yet).

@ties
Copy link
Collaborator Author

ties commented Jul 11, 2022

WIP because I'm running this functionality in testing at the moment

@ties ties force-pushed the feature/grace-period-for-diff branch from 2fb7c6f to 5b022de Compare July 11, 2022 15:27
ties added 2 commits July 11, 2022 17:41
When a VRP disappears from one input, but it still present in the
other input, an immediate difference between sources is created.

This commits adds a grace period during which elements that disappear
do not cause alerts (yet).
@ties ties force-pushed the feature/grace-period-for-diff branch from 5b022de to 6149d5f Compare July 11, 2022 15:41
@ties ties changed the title WIP: Grace period for diff Grace period for diff Jul 12, 2022
@ties
Copy link
Collaborator Author

ties commented Jul 12, 2022

This ran well overnight. I added some tests, which probably can improve in style 🙂

@job job merged commit 8d18a41 into bgp:master Jul 12, 2022
@job
Copy link
Member

job commented Jul 12, 2022

Thanks @ties

@ties ties deleted the feature/grace-period-for-diff branch July 12, 2022 19:06
@@ -55,6 +55,7 @@ var (

UserAgent = flag.String("useragent", fmt.Sprintf("StayRTR-%v (+https://github.com/bgp/stayrtr)", AppVersion), "User-Agent header")
DisableConditionalRequests = flag.Bool("disable.conditional.requests", false, "Disable conditional requests (using If-None-Match/If-Modified-Since headers)")
GracePeriod = flag.Duration("grace.period", time.Minute*20, "Grace period during which objects removed from a source are not considered for the diff")
Copy link

Choose a reason for hiding this comment

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

I'm just skimming really and no expert in Golang either.
Is there a way to set this GracePeriod via configuration file?

@ties
Copy link
Collaborator Author

ties commented Jul 13, 2022 via email

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.

3 participants