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 5603609 commit 9dd6df6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/haproxy/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ func (c *clientNative) processServers(backendName string, configuration configur
errCreateServer := configuration.CreateServer("backend", backendName, server, c.activeTransaction, 0)
if errCreateServer != nil {
errs.Add(configuration.EditServer(server.Name, "backend", backendName, server, c.activeTransaction, 0))
} 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'", server.Name, backendName)
}
}
return errs
Expand Down

0 comments on commit 9dd6df6

Please sign in to comment.