Format workerID as string
This commit is contained in:
parent
375b7a1c4c
commit
f3838a47c7
4
extern/sector-storage/manager.go
vendored
4
extern/sector-storage/manager.go
vendored
@ -58,6 +58,10 @@ type SectorManager interface {
|
|||||||
type WorkerID uuid.UUID // worker session UUID
|
type WorkerID uuid.UUID // worker session UUID
|
||||||
var ClosedWorkerID = uuid.UUID{}
|
var ClosedWorkerID = uuid.UUID{}
|
||||||
|
|
||||||
|
func (w WorkerID) String() string {
|
||||||
|
return uuid.UUID(w).String()
|
||||||
|
}
|
||||||
|
|
||||||
type Manager struct {
|
type Manager struct {
|
||||||
ls stores.LocalStorage
|
ls stores.LocalStorage
|
||||||
storage *stores.Remote
|
storage *stores.Remote
|
||||||
|
8
extern/sector-storage/sched_resources.go
vendored
8
extern/sector-storage/sched_resources.go
vendored
@ -49,25 +49,25 @@ func (a *activeResources) canHandleRequest(needRes Resources, wid WorkerID, call
|
|||||||
// TODO: dedupe needRes.BaseMinMemory per task type (don't add if that task is already running)
|
// TODO: dedupe needRes.BaseMinMemory per task type (don't add if that task is already running)
|
||||||
minNeedMem := res.MemReserved + a.memUsedMin + needRes.MinMemory + needRes.BaseMinMemory
|
minNeedMem := res.MemReserved + a.memUsedMin + needRes.MinMemory + needRes.BaseMinMemory
|
||||||
if minNeedMem > res.MemPhysical {
|
if minNeedMem > res.MemPhysical {
|
||||||
log.Debugf("sched: not scheduling on worker %d for %s; not enough physical memory - need: %dM, have %dM", wid, caller, minNeedMem/mib, res.MemPhysical/mib)
|
log.Debugf("sched: not scheduling on worker %s for %s; not enough physical memory - need: %dM, have %dM", wid, caller, minNeedMem/mib, res.MemPhysical/mib)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
maxNeedMem := res.MemReserved + a.memUsedMax + needRes.MaxMemory + needRes.BaseMinMemory
|
maxNeedMem := res.MemReserved + a.memUsedMax + needRes.MaxMemory + needRes.BaseMinMemory
|
||||||
|
|
||||||
if maxNeedMem > res.MemSwap+res.MemPhysical {
|
if maxNeedMem > res.MemSwap+res.MemPhysical {
|
||||||
log.Debugf("sched: not scheduling on worker %d for %s; not enough virtual memory - need: %dM, have %dM", wid, caller, maxNeedMem/mib, (res.MemSwap+res.MemPhysical)/mib)
|
log.Debugf("sched: not scheduling on worker %s for %s; not enough virtual memory - need: %dM, have %dM", wid, caller, maxNeedMem/mib, (res.MemSwap+res.MemPhysical)/mib)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if a.cpuUse+needRes.Threads(res.CPUs) > res.CPUs {
|
if a.cpuUse+needRes.Threads(res.CPUs) > res.CPUs {
|
||||||
log.Debugf("sched: not scheduling on worker %d for %s; not enough threads, need %d, %d in use, target %d", wid, caller, needRes.Threads(res.CPUs), a.cpuUse, res.CPUs)
|
log.Debugf("sched: not scheduling on worker %s for %s; not enough threads, need %d, %d in use, target %d", wid, caller, needRes.Threads(res.CPUs), a.cpuUse, res.CPUs)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(res.GPUs) > 0 && needRes.CanGPU {
|
if len(res.GPUs) > 0 && needRes.CanGPU {
|
||||||
if a.gpuUsed {
|
if a.gpuUsed {
|
||||||
log.Debugf("sched: not scheduling on worker %d for %s; GPU in use", wid, caller)
|
log.Debugf("sched: not scheduling on worker %s for %s; GPU in use", wid, caller)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
extern/sector-storage/sched_worker.go
vendored
2
extern/sector-storage/sched_worker.go
vendored
@ -486,6 +486,6 @@ func (sh *scheduler) workerCleanup(wid WorkerID, w *workerHandle) {
|
|||||||
}
|
}
|
||||||
sh.openWindows = newWindows
|
sh.openWindows = newWindows
|
||||||
|
|
||||||
log.Debugf("worker %d dropped", wid)
|
log.Debugf("worker %s dropped", wid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user