Skip to content

Commit

Permalink
fix: correct api healthcheck concurrency which could get stale on con…
Browse files Browse the repository at this point in the history
…current request (#125)

fix: correct api healthcheck concurrency which could get stale on concurrent request (#125)
  • Loading branch information
rdoorn authored Jan 16, 2020
1 parent b1631e7 commit 1e4518c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkg/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ func (m *Manager) SetStatus(uuid string, status Status) error {
func (m *Manager) sendWorkerUpdate(uuid string) {
for _, worker := range m.Workers {
if worker.UUIDStr == uuid {
worker.sendUpdate(worker.CheckResult) // send update with no change
// do update in the background, don't wait for it
go worker.sendUpdate(worker.CheckResult) // send update with no change
}
}
}
6 changes: 3 additions & 3 deletions test/mercury-template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ method = "sticky,leastconnected"
[[loadbalancer.pools.INTERNAL_VIP_LB.backends.example_lc.healthchecks]]
# httpreply = "login"
httpstatus = 200
httprequest = "https://www.ghostbox.org"
httprequest = "https://www.exmple.com"
# httppostdata = "<bla>"
type = "httpget"
# httpheaders = ["Content-Type: application/soap+xml; charset=utf-8"]
Expand Down Expand Up @@ -606,10 +606,10 @@ domain = "dnsonly.nl"
hostname = "test_lb_dns"
ip = "%LOCALIP%"
[[loadbalancer.pools.test_tcp.backends.test_lb_dns.nodes]]
hostname = "server2.local"
hostname = "server2"
ip = "95.142.102.176"
port = 80
[[loadbalancer.pools.test_tcp.backends.test_lb_dns.nodes]]
hostname = "server1.local"
hostname = "server1"
ip = "95.142.102.175"
port = 79

0 comments on commit 1e4518c

Please sign in to comment.