Skip to content

Commit f480af3

Browse files
hdurand0710oktalz
authored andcommitted
BUG/MEDIUM: reload the configuration after a failed synced configuration 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.
1 parent 49d4230 commit f480af3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/service/endpoints.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ func (s *Service) updateHAProxySrv(client api.HAProxyClient, srvSlot store.HAPro
8484
errAPI = client.BackendServerCreate(s.backend.Name, srv)
8585
if errAPI != nil {
8686
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)
87+
} else {
88+
// Server has been created, a reload is required
89+
// It covers the case where there was a failure, scaleHAProxySrvs has already been called in a previous loop
90+
// but the sync failed (wrong config)
91+
// When the config is fixed, servers will be created
92+
instance.Reload("server '%s' created in backend '%s'", srv.Name, s.backend.Name)
8793
}
8894
} else {
8995
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)

0 commit comments

Comments
 (0)