Skip to content

Commit 7953394

Browse files
committed
BUG/MEDIUM: drop dynamic map update
dropping dynamic map update and getting back to update via reloads until the follwing issues are fixed: Currently dynamic map update is done by clearing map file and then pushing content via the runtime socket using the payload syntax - haproxy needs to provide a transactional way of updating map files via runtime socket. In order not to have incorrect map content between the time content is cleared and replaced. - updating map file via a payload limits content size to tune.bufsize which is 16k by default: https://cbonte.github.io/haproxy-dconv/2.3/management.html#9.3
1 parent 2650e29 commit 7953394

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

controller/haproxy/maps.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,18 @@ func (m Maps) Refresh(client api.HAProxyClient) (reload bool) {
8989
defer f.Close()
9090
if _, err = f.WriteString(content); err != nil {
9191
logger.Error(err)
92+
continue
9293
}
9394
logger.Error(f.Sync())
94-
if err = client.SetMapContent(name, content); err != nil {
95-
if strings.HasPrefix(err.Error(), "maps dir doesn't exists") {
96-
logger.Debugf("creating Map file %s", name)
97-
} else {
98-
logger.Warningf("dynamic update of '%s' Map file failed: %s", name, err.Error()[:200])
99-
}
100-
reload = true
101-
}
95+
reload = true
96+
// if err = client.SetMapContent(name, content); err != nil {
97+
// if strings.HasPrefix(err.Error(), "maps dir doesn't exists") {
98+
// logger.Debugf("creating Map file %s", name)
99+
// } else {
100+
// logger.Warningf("dynamic update of '%s' Map file failed: %s", name, err.Error()[:200])
101+
// }
102+
// reload = true
103+
// }
102104
}
103105
return reload
104106
}

0 commit comments

Comments
 (0)