Skip to content

Commit f41730e

Browse files
committed
removed unwanted changes related to induced delays during execution
1 parent 986a1b9 commit f41730e

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

lib/workerbroker.go

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"os/signal"
2525
"sync"
2626
"syscall"
27-
"time"
2827
)
2928

3029
// HeraWorkerType defines the possible worker type
@@ -327,7 +326,6 @@ func (broker *WorkerBroker) startWorkerMonitor() (err error) {
327326
logger.GetLogger().Log(logger.Debug, "worker (id=", workerclient.ID, "pid=", workerclient.pid, ") received signal. transits from state ", workerclient.Status, " to terminated.")
328327
}
329328
workerclient.setState(wsUnset) // Set the state to UNSET to make sure worker does not stay in FNSH state so long
330-
time.Sleep(5 * time.Second)
331329
pool.RestartWorker(workerclient)
332330
}
333331
} else {

lib/workerclient.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ func (worker *WorkerClient) initiateRecover(param int, p *WorkerPool, prior Hera
591591
param = common.StrandedSkipBreakHiLoad
592592
}
593593
} else {
594-
rv = time.After(time.Millisecond * 100000)
594+
rv = time.After(time.Millisecond * time.Duration(GetConfig().StrandedWorkerTimeoutMs))
595595
}
596596
buff := []byte{byte(param), byte((worker.rqId & 0xFF000000) >> 24), byte((worker.rqId & 0x00FF0000) >> 16),
597597
byte((worker.rqId & 0x0000FF00) >> 8), byte((worker.rqId & 0x000000FF))}

lib/workerpool.go

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ func (pool *WorkerPool) RestartWorker(worker *WorkerClient) (err error) {
193193
}
194194
pool.activeQ.Remove(worker)
195195
pool.poolCond.L.Unlock()
196-
time.Sleep(time.Millisecond * 3000)
197196
go pool.spawnWorker(worker.ID)
198197
return nil
199198
}

0 commit comments

Comments
 (0)