Synchronously update the target configuration upon failure. (#1671)

* Synchronously update the target configuration upon failure.

* Notice a serverInfo failure when key updates fail.

* Add server name to debug logs.
This commit is contained in:
Christopher Wood 2021-04-17 07:35:55 -07:00 committed by GitHub
parent 9759dd90a2
commit 23588733ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -698,8 +698,17 @@ func (proxy *Proxy) processIncomingQuery(clientProto string, serverProto string,
response = nil
}
} else if responseCode == 401 {
dlog.Notice("Forcing key update")
go proxy.serversInfo.refresh(proxy)
dlog.Notice("Forcing key update for " + serverInfo.Name)
for _, registeredServer := range proxy.serversInfo.registeredServers {
if registeredServer.name == serverInfo.Name {
if err = proxy.serversInfo.refreshServer(proxy, registeredServer.name, registeredServer.stamp); err != nil {
// Failed to refresh the proxy server information.
dlog.Notice("Key update failed for " + serverInfo.Name)
serverInfo.noticeFailure(proxy)
}
break
}
}
response = nil
} else {
dlog.Error("Failed to receive successful response")