Skip to content

controller: scope the reconcile mutex onto the reconciler#68

Open
tamalsaha wants to merge 1 commit into
masterfrom
refactor/scope-mutex-to-receiver
Open

controller: scope the reconcile mutex onto the reconciler#68
tamalsaha wants to merge 1 commit into
masterfrom
refactor/scope-mutex-to-receiver

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

The serialization lock used by `Reconcile` and `handleDeletion` lived as a package-level `var mutex sync.Mutex`. Moving it onto `ExternalDNSReconciler` makes its scope obvious and lets the doc comment record why it exists in the first place — the credential layer mutates process-wide env vars and well-known disk paths.

No behavior change. This is the small refactor that paves the way for plumbing per-resource credentials through and dropping the lock entirely.

Test plan

  • `go build ./...`
  • Reconcile a single ExternalDNS to confirm lock contention behavior is identical (only one reconcile at a time)

The package-level `var mutex sync.Mutex` made the lock implicit and
ungrep-able. Move it onto ExternalDNSReconciler as `reconcileMu` and
document the real reason it exists: the credential layer mutates
process-wide env vars and well-known on-disk paths, so two reconciles
for different providers cannot run concurrently today.

No behavior change. The doc comment names the followup needed before we
can bump MaxConcurrentReconciles.

Signed-off-by: Tamal Saha <tamal@appscode.com>
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.

1 participant