ubik: Do not count votes from error'd connections
authorAndrew Deason <adeason@sinenomine.net>
Tue, 20 Nov 2012 21:00:15 +0000 (15:00 -0600)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 18 Dec 2012 19:36:16 +0000 (11:36 -0800)
If the given connection has a connection-wide error on it, the vote we
got from that site is probably not valid, and we could easily be
interpreting an error code as a vote time. So instead, treat the host
as if we got a network error from it.

Change-Id: Ib9253bf6c24493be1c0d16b9252deecec4e43c2a
Reviewed-on: http://gerrit.openafs.org/8487
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/ubik/beacon.c

index 1ff45ec..088e605 100644 (file)
@@ -512,6 +512,12 @@ ubeacon_Interact(void *dummy)
                               (int)code, afs_inet_ntoa_r(ts->addr[0], hoststr));
                    code = -1;
                }
+               if (code > 0 && rx_ConnError(connections[multi_i])) {
+                   ubik_print("assuming vote from %s is invalid due to conn error %d; marking host down\n",
+                              afs_inet_ntoa_r(ts->addr[0], hoststr),
+                              (int)rx_ConnError(connections[multi_i]));
+                   code = -1;
+               }
 
                /* note that the vote time (the return code) represents the time
                 * the vote was computed, *not* the time the vote expires.  We compute