Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gorsing
Copy link

@gorsing gorsing commented Oct 8, 2024

1. Why is this pull request needed and what does it do?

This pull request introduces improvements to the reload functionality of CoreDNS. It refines the logic for periodically checking for changes in the Corefile configuration and enhances the shutdown procedure for the reload goroutine. Specifically, it:

  1. Implements a more reliable quit channel mechanism using chan struct{} to signal the reload routine to stop.
  2. Ensures that the interval and jitter settings are adjustable and properly logged, enhancing the usability of the reload plugin.
  3. Prevents race conditions and ensures synchronized access to shared variables between setup and the onInstanceStartup hook.

2. Which issues (if any) are related?

This PR addresses the need for a more robust and synchronized reload mechanism in CoreDNS, improving overall stability.
The problem remains #6646 #6645

3. Which documentation changes (if any) need to be made?

No documentation changes are needed.

4. Does this introduce a backward incompatible change or deprecation?

No, this pull request does not introduce any backward incompatible changes or deprecations. It enhances existing functionality while maintaining compatibility with current configurations.

@gorsing gorsing requested a review from johnbelamaric as a code owner October 8, 2024 15:45
@gorsing gorsing force-pushed the fix/reload-close-channel branch from be29904 to ceb6c89 Compare October 8, 2024 16:00
@gorsing gorsing changed the title Fix/reload close channel fix: reload close channel Oct 8, 2024
Signed-off-by: Sergii Kuzko <[email protected]>
Signed-off-by: Sergii Kuzko <[email protected]>
@chrisohaver
Copy link
Member

I cant put my finger on the significance of these changes. Palpably, what problem do these changes resolve?

@gorsing
Copy link
Author

gorsing commented Oct 25, 2024

Problem with the problem code #6646 #6645
The code opens Goroutines but does not close it. and this in combination with the reload and etcd plugins causes a memory leak

@chrisohaver
Copy link
Member

Problem with the problem code #6646 #6645 The code opens Goroutines but does not close it. and this in combination with the reload and etcd plugins causes a memory leak

I don't see how this code changes the behavior. It looks like go routines were closed before, and they are still closed after these changes. Can you show how in the previous code that the go routines were not closed?

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.

2 participants