Skip to content

Commit a3aad0c

Browse files
committed
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 0e61c24 commit a3aad0c

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
@@ -87,6 +87,12 @@ func (s *Service) updateHAProxySrv(client api.HAProxyClient, srvSlot store.HAPro
8787
errAPI = client.BackendServerCreate(s.backend.Name, srv)
8888
if errAPI != nil {
8989
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)
90+
} else {
91+
// Server has been created, a reload is required
92+
// It covers the case where there was a failure, scaleHAProxySrvs has already been called in a previous loop
93+
// but the sync failed (wrong config)
94+
// When the config is fixed, servers will be created
95+
instance.Reload("server '%s' created in backend '%s'", srv.Name, s.backend.Name)
9096
}
9197
} else {
9298
logger.Errorf("[CONFIG] [BACKEND] [SERVER] %v", errAPI)

0 commit comments

Comments
 (0)