Skip to content

Commit

Permalink
BUG/MEDIUM: reload the configuration after a failed synced configurat…
Browse files Browse the repository at this point in the history
…ion if servers are created

Fix the scenario where we have a failure when we sync the configuration and we scale a deployment before fixing the issue.
In this scenario we were writing the configuration correctly with the new servers but not reloading.
The runtime still had missing servers, it was capped to the server slots number of servers.
  • Loading branch information
hdurand0710 authored and oktalz committed Feb 3, 2025
1 parent 49d4230 commit f480af3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/service/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ func (s *Service) updateHAProxySrv(client api.HAProxyClient, srvSlot store.HAPro
errAPI = client.BackendServerCreate(s.backend.Name, srv)
if errAPI != nil {
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)
} else {
// Server has been created, a reload is required
// It covers the case where there was a failure, scaleHAProxySrvs has already been called in a previous loop
// but the sync failed (wrong config)
// When the config is fixed, servers will be created
instance.Reload("server '%s' created in backend '%s'", srv.Name, s.backend.Name)
}
} else {
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)
Expand Down

0 comments on commit f480af3

Please sign in to comment.