Skip to content

Conversation

gandro
Copy link
Member

@gandro gandro commented Jun 12, 2024

This PR optimizes the time FQDN Go routines linger around when waiting on datapath updates. Before this PR, they would wait until the datapath update finished, even though the parent already decided to moved on without waiting on the datpath update.

See commit messages and #32769 (comment) for further details

@gandro gandro added kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. area/fqdn Affects the FQDN policies feature labels Jun 12, 2024
@gandro gandro requested review from a team as code owners June 12, 2024 10:14
@gandro gandro requested review from nebril and doniacld June 12, 2024 10:14
@github-actions github-actions bot added the sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. label Jun 12, 2024
@gandro gandro force-pushed the pr/gandro/dns-exit-lingering-go-routine-early branch from 15c208f to 34b9b9d Compare June 12, 2024 10:18
@gandro
Copy link
Member Author

gandro commented Jun 12, 2024

/test

@gandro gandro force-pushed the pr/gandro/dns-exit-lingering-go-routine-early branch from 34b9b9d to aeca814 Compare June 13, 2024 10:37
@gandro
Copy link
Member Author

gandro commented Jun 13, 2024

/test

Rebased to pull in the needed fixes for ingress/gatewayapi CI

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 13, 2024
@gandro gandro removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 13, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 13, 2024
gandro added 2 commits June 13, 2024 15:10
This adds a context argument to WaitForRevision, allowing callers to
abort the call.

For logic for the cancellation of the `Cond` var using
`context.AfterFunc` was taken from the Go docs:
https://pkg.go.dev/context#AfterFunc

The commit also fixes an issue with the existing unit test
where it waited for revision 0 instead of revision 1.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
This commit changes the `UpdateGenerateDNS` function to return a
errgroup instead of a waitgroup. This allows the caller to determine
after `Wait` if the datapath update timed out or not.

This then allows `UpdateGenerateDNS` to stop the errgroup, allowing the
go routine spawned in `notifyOnDNSMsg` to exit early as well upon
cancellation. This way, the go routine in `notifyOnDNSMsg` does not need
to linger until the datapath update has finished.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro force-pushed the pr/gandro/dns-exit-lingering-go-routine-early branch from aeca814 to cd6392c Compare June 13, 2024 13:12
@gandro gandro removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 13, 2024
@gandro
Copy link
Member Author

gandro commented Jun 13, 2024

/test

Copy link
Contributor

@doniacld doniacld left a comment

Choose a reason for hiding this comment

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

Congrats 🙌 Good job!

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 13, 2024
@gandro gandro added this pull request to the merge queue Jun 14, 2024
Merged via the queue into cilium:main with commit fd29852 Jun 14, 2024
@gandro gandro deleted the pr/gandro/dns-exit-lingering-go-routine-early branch June 14, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/fqdn Affects the FQDN policies feature kind/cleanup This includes no functional changes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/policy Impacts whether traffic is allowed or denied based on user-defined policies.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants