Skip to content

fix: handleNotify goroutine checks s.done before refreshZone#145

Merged
poyrazK merged 1 commit intomainfrom
fix/shutdown-goroutine-leak
May 7, 2026
Merged

fix: handleNotify goroutine checks s.done before refreshZone#145
poyrazK merged 1 commit intomainfrom
fix/shutdown-goroutine-leak

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented May 7, 2026

Summary

Fixes #82.

Test plan

  • go build ./... — clean build
  • go test ./... -timeout 60s — all tests pass

Note: Issue #80 was investigated and found to be already fixed in the current codebase. The wg.Add(1) is correctly called before go func() at health_monitor.go:112.

The handleNotify async goroutine only checked s.done once at startup,
then proceeded to long-running operations (Repo.GetZone, refreshZone)
without further shutdown checks. Add a second check before refreshZone
to allow early exit during server shutdown, avoiding unnecessary work.

Fixes #82.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c3259de-4b9f-404e-925f-3ed44e78ab4a

📥 Commits

Reviewing files that changed from the base of the PR and between ed1f7ee and f0553e5.

📒 Files selected for processing (1)
  • internal/dns/server/server.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/shutdown-goroutine-leak

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

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

It's okay to merge

@poyrazK poyrazK merged commit 21acd90 into main May 7, 2026
7 checks passed
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.

handleNotify goroutine ignores s.done, may leak on shutdown

1 participant