Skip to content

Commit

Permalink
removed unwanted changes related to induced delays during execution
Browse files Browse the repository at this point in the history
  • Loading branch information
rasamala83 committed Jan 20, 2025
1 parent 986a1b9 commit f41730e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions lib/workerbroker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"os/signal"
"sync"
"syscall"
"time"
)

// HeraWorkerType defines the possible worker type
Expand Down Expand Up @@ -327,7 +326,6 @@ func (broker *WorkerBroker) startWorkerMonitor() (err error) {
logger.GetLogger().Log(logger.Debug, "worker (id=", workerclient.ID, "pid=", workerclient.pid, ") received signal. transits from state ", workerclient.Status, " to terminated.")
}
workerclient.setState(wsUnset) // Set the state to UNSET to make sure worker does not stay in FNSH state so long
time.Sleep(5 * time.Second)
pool.RestartWorker(workerclient)
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/workerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ func (worker *WorkerClient) initiateRecover(param int, p *WorkerPool, prior Hera
param = common.StrandedSkipBreakHiLoad
}
} else {
rv = time.After(time.Millisecond * 100000)
rv = time.After(time.Millisecond * time.Duration(GetConfig().StrandedWorkerTimeoutMs))
}
buff := []byte{byte(param), byte((worker.rqId & 0xFF000000) >> 24), byte((worker.rqId & 0x00FF0000) >> 16),
byte((worker.rqId & 0x0000FF00) >> 8), byte((worker.rqId & 0x000000FF))}
Expand Down
1 change: 0 additions & 1 deletion lib/workerpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func (pool *WorkerPool) RestartWorker(worker *WorkerClient) (err error) {
}
pool.activeQ.Remove(worker)
pool.poolCond.L.Unlock()
time.Sleep(time.Millisecond * 3000)
go pool.spawnWorker(worker.ID)
return nil
}
Expand Down

0 comments on commit f41730e

Please sign in to comment.