Skip to content

fix(client): enforce MaxConcurrentClusterConnects on physical dials - #666

Merged
SunSi12138 merged 1 commit into
devfrom
fix/661-cluster-dial-concurrency
Sep 12, 2026
Merged

SunSi12138 merged 1 commit into
devfrom
fix/661-cluster-dial-concurrency

Conversation

@SunSi12138

Copy link
Copy Markdown
Owner

Closes #661

Summary

  • define MaxConcurrentClusterConnects as a coordinator-wide cap on concurrent physical child IClientTransportFactory.ConnectAsync attempts
  • bind one shared dial limiter to initial child slots and runtime Add/Replace candidates
  • route fixed, static-cluster, and dynamic-cluster dial paths through the shared boundary, covering initial connect, reconnect, pool expansion, and dynamic endpoint generations
  • release permits exactly once on success, failure, or cancellation without touching the ordinary RPC hot path
  • preserve fix(client): decouple runtime cluster add from readiness #660 running Add semantics: Start -> publish -> background readiness convergence; Add does not wait for remote Ready

Tests

Adds deterministic multi-cluster coverage for:

  • initial child supervisors respecting the physical dial bound
  • running Add publishing while its dial waits for a permit
  • reconnect sharing the permit with a runtime-added child
  • Replace candidates sharing the same physical dial boundary
  • Stop cancelling permit owners/waiters without shutdown deadlock

The branch is based on the current dev head (5fac7a0ef6c96b2aa092160c2c89559695bf9b15).

Define MaxConcurrentClusterConnects as a shared cap on physical child transport ConnectAsync attempts across initial connectivity, reconnect, pool expansion, runtime Add/Replace candidates, and dynamic endpoint generations. Preserve running Add publication/readiness decoupling and add deterministic concurrency and shutdown coverage.

Closes #661
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