Skip to content

Conversation

the-glu
Copy link
Contributor

@the-glu the-glu commented Sep 2, 2025

Base version for implementation of #1250 , with some open questions :)

Doesn't include infrastructure changes.

checkScdSubs = flags.Bool("scd_sub", true, "set this flag to true to check for expired SCD subscriptions")
checkRidISAs = flags.Bool("rid_isa", true, "set this flag to true to check for expired RID ISAs")
checkRidSubs = flags.Bool("rid_sub", true, "set this flag to true to check for expired RID subscriptions")
ttl = flags.Duration("ttl", time.Hour*24*112, "time-to-live duration used for determining SCD entries expiration, defaults to 2*56 days which should be a safe value in most cases")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question about ttl. Should we:

  • Use a common value ?
  • Use a separate parameter ?
  • Use a fixed value of 30m, hardcoded in rid store (like previous cron)

Currently version 3 is implemented

Copy link
Contributor

Choose a reason for hiding this comment

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

I may expect different jobs running at different frequency for each services. So I would suggest to keep ttl and apply it to all 4 resources. If a different value is required, several job can be configured. You may want to validate this assumption on the issue.

Comment on lines +142 to 144
if err = ridStore.Transact(ctx, ridAction); err != nil {
return fmt.Errorf("failed to execute RID transaction: %w", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we might want to completely skip the action when there's not flag associated to the store

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hum, not sure I agree: we left the function itself to decide what to run, no need to copy-paste and maintain the logic at two location no? It has no performance impact?

Copy link
Contributor

@barroco barroco left a comment

Choose a reason for hiding this comment

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

Did a first pass. Will review again once the ttl strategy is final.

checkScdSubs = flags.Bool("scd_sub", true, "set this flag to true to check for expired SCD subscriptions")
checkRidISAs = flags.Bool("rid_isa", true, "set this flag to true to check for expired RID ISAs")
checkRidSubs = flags.Bool("rid_sub", true, "set this flag to true to check for expired RID subscriptions")
ttl = flags.Duration("ttl", time.Hour*24*112, "time-to-live duration used for determining SCD entries expiration, defaults to 2*56 days which should be a safe value in most cases")
Copy link
Contributor

Choose a reason for hiding this comment

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

I may expect different jobs running at different frequency for each services. So I would suggest to keep ttl and apply it to all 4 resources. If a different value is required, several job can be configured. You may want to validate this assumption on the issue.

logExpiredEntity("SCD subscription", sub.ID, threshold, *deleteExpired, sub.EndTime != nil)
}
for _, isa := range expiredISAs {
logExpiredEntity("ISA", isa.ID, time.Now().Add(-time.Duration(ridc.ExpiredDurationInMin)*time.Minute), *deleteExpired, isa.EndTime != nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming the deletion in the action above takes a lot of time, the usage of time.Now() seems inappropriate.

logExpiredEntity("ISA", isa.ID, time.Now().Add(-time.Duration(ridc.ExpiredDurationInMin)*time.Minute), *deleteExpired, isa.EndTime != nil)
}
for _, sub := range ridExpiredSub {
logExpiredEntity("RID subscription", sub.ID, time.Now().Add(-time.Duration(ridc.ExpiredDurationInMin)*time.Minute), *deleteExpired, sub.EndTime != nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same remark here.

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