Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SurgicalPool extension by the load balancing algorithm (the same way as the RoutePool) #457

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,12 @@ func (r *RouteRegistry) LookupWithInstance(uri route.Uri, appID string, appIndex
p.Each(func(e *route.Endpoint) {
if (e.ApplicationId == appID) && (e.PrivateInstanceIndex == appIndex) {
surgicalPool = route.NewPool(&route.PoolOpts{
Logger: r.logger,
RetryAfterFailure: 0,
Host: p.Host(),
ContextPath: p.ContextPath(),
MaxConnsPerBackend: p.MaxConnsPerBackend(),
Logger: r.logger,
RetryAfterFailure: 0,
Host: p.Host(),
ContextPath: p.ContextPath(),
MaxConnsPerBackend: p.MaxConnsPerBackend(),
LoadBalancingAlgorithm: p.LoadBalancingAlgorithm,
})
surgicalPool.Put(e)
}
Expand Down
4 changes: 3 additions & 1 deletion route/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ func (p *EndpointPool) Endpoints(logger *slog.Logger, initial string, mustBeStic
logger.Debug("endpoint-iterator-with-round-robin-lb-algo")
return NewRoundRobin(logger, p, initial, mustBeSticky, azPreference == config.AZ_PREF_LOCAL, az)
default:
logger.Error("invalid-pool-load-balancing-algorithm", slog.String("poolLBAlgorithm", p.LoadBalancingAlgorithm))
logger.Error("invalid-pool-load-balancing-algorithm",
slog.String("poolLBAlgorithm", p.LoadBalancingAlgorithm),
slog.Group("data", slog.String("Host", p.host)))
Dariquest marked this conversation as resolved.
Show resolved Hide resolved
return NewRoundRobin(logger, p, initial, mustBeSticky, azPreference == config.AZ_PREF_LOCAL, az)
}
}
Expand Down