Improve error messages in agnhost/guestbook

This updates the error messages when registering a
node to be more explicit about what error occurred
and how long it will wait to retry.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
This commit is contained in:
hasheddan 2020-05-12 09:57:39 -05:00
parent 0cacc44fc9
commit 9081dfb68d
No known key found for this signature in database
GPG Key ID: BD68BC686A14C271

View File

@ -84,14 +84,14 @@ func registerNode(registerTo, port string) {
for time.Since(start) < timeout {
_, err := net.ResolveTCPAddr("tcp", hostPort)
if err != nil {
log.Printf("--slaveof param and/or --backend-port param are invalid. %v. Retrying in 1 second.", err)
log.Printf("unable to resolve %s, --slaveof param and/or --backend-port param are invalid: %v. Retrying in %s.", hostPort, err, sleep)
time.Sleep(sleep)
continue
}
response, err := dialHTTP(request, hostPort)
if err != nil {
log.Printf("encountered error while registering to master: %v. Retrying in 1 second.", err)
log.Printf("encountered error while registering to master: %v. Retrying in %s.", err, sleep)
time.Sleep(sleep)
continue
}