@ -307,13 +307,6 @@ func waitForFormatXL(firstDisk bool, endpoints Endpoints, setCount, drivesPerSet
return nil , err
return nil , err
}
}
// Done channel is used to close any lingering retry routine, as soon
// as this function returns.
doneCh := make ( chan struct { } )
// Indicate to our retry routine to exit cleanly, upon this function return.
defer close ( doneCh )
// prepare getElapsedTime() to calculate elapsed time since we started trying formatting disks.
// prepare getElapsedTime() to calculate elapsed time since we started trying formatting disks.
// All times are rounded to avoid showing milli, micro and nano seconds
// All times are rounded to avoid showing milli, micro and nano seconds
formatStartTime := time . Now ( ) . Round ( time . Second )
formatStartTime := time . Now ( ) . Round ( time . Second )
@ -321,13 +314,16 @@ func waitForFormatXL(firstDisk bool, endpoints Endpoints, setCount, drivesPerSet
return time . Now ( ) . Round ( time . Second ) . Sub ( formatStartTime ) . String ( )
return time . Now ( ) . Round ( time . Second ) . Sub ( formatStartTime ) . String ( )
}
}
// Wait on the jitter retry loop.
// Wait on each try for an update.
retryTimerCh := newRetryTimerSimple ( doneCh )
ticker := time . NewTicker ( 500 * time . Millisecond )
defer ticker . Stop ( )
var tries int
for {
for {
select {
select {
case retryCount := <- retryTimerCh :
case <- ticker . C :
format , err := connectLoadInitFormats ( retryCount , firstDisk , endpoints , setCount , drivesPerSet , deploymentID )
format , err := connectLoadInitFormats ( tries , firstDisk , endpoints , setCount , drivesPerSet , deploymentID )
if err != nil {
if err != nil {
tries ++
switch err {
switch err {
case errNotFirstDisk :
case errNotFirstDisk :
// Fresh setup, wait for first server to be up.
// Fresh setup, wait for first server to be up.