Skip to content

Commit

Permalink
Merge pull request #1417 from pperiyasamy/egressfirewall-dns-update-p…
Browse files Browse the repository at this point in the history
…anic-4.11

[release-4.11] OCPBUGS-4475: Handle expired entry while handling dns update
  • Loading branch information
openshift-merge-robot committed Dec 13, 2022
2 parents 54d844f + ad0a282 commit fbc34a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions go-controller/pkg/ovn/egressfirewall_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ func (e *EgressDNS) Run(defaultInterval time.Duration) {
// find the domain name whose DNS entry will expire first and calculate when it will expire,
// set timer to what's sooner: default update interval or next expiration time
ttl, domainNameExpiringNext, timeSet = e.dns.GetNextQueryTime()
if time.Until(ttl) > defaultInterval || !timeSet {
ttlDuration := time.Until(ttl)
if ttlDuration > defaultInterval || !timeSet {
durationTillNextQuery = defaultInterval
} else if ttlDuration.Seconds() > 0 {
durationTillNextQuery = ttlDuration
} else {
durationTillNextQuery = time.Until(ttl)
// DNS entry is already expired, so trigger tick as soon as possible.
durationTillNextQuery = 1 * time.Millisecond
}
timer.Reset(durationTillNextQuery)
}
Expand Down

0 comments on commit fbc34a5

Please sign in to comment.