File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ static struct {
46
46
int * leader ;
47
47
} shared ;
48
48
49
+ static bool try_next_leader = true;
49
50
static int leadersock = -1 ;
50
51
static WorkerConfig wcfg ;
51
52
static char * peerstr ;
@@ -78,8 +79,8 @@ static void disconnect_leader(void)
78
79
if (leadersock >= 0 )
79
80
{
80
81
close (leadersock );
82
+ try_next_leader = true;
81
83
}
82
- select_next_peer ();
83
84
leadersock = -1 ;
84
85
}
85
86
@@ -172,7 +173,8 @@ static bool connect_leader(timeout_t *timeout)
172
173
173
174
HostPort * leaderhp ;
174
175
175
- if (* shared .leader == NOBODY ) select_next_peer ();
176
+ // if (*shared.leader == NOBODY) select_next_peer();
177
+ if (try_next_leader ) select_next_peer ();
176
178
177
179
leaderhp = wcfg .peers + * shared .leader ;
178
180
<
3759
/td>
You can’t perform that action at this time.
0 commit comments