Skip to content

Commit 1ca4940

Browse files
committed
Sch: Fix worker_time_pressure access of dead worker
1 parent 66ba6a9 commit 1ca4940

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/sch/Sch.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,6 @@ function init_proc(state, p, log_sink)
323323
gproc = OSProc(p.pid)
324324
lock(state.lock) do
325325
state.worker_time_pressure[p.pid] = Dict{Processor,UInt64}()
326-
for proc in get_processors(gproc)
327-
state.worker_time_pressure[p.pid][proc] = 0
328-
end
329326

330327
state.worker_storage_pressure[p.pid] = Dict{Union{StorageResource,Nothing},UInt64}()
331328
state.worker_storage_capacity[p.pid] = Dict{Union{StorageResource,Nothing},UInt64}()
@@ -768,7 +765,9 @@ function schedule!(ctx, state, procs=procs_to_use(ctx))
768765
Vector{Tuple{Thunk,<:Any,<:Any,UInt64,UInt32}}()
769766
end
770767
push!(proc_tasks, (task, scope, est_time_util, est_alloc_util, est_occupancy))
771-
state.worker_time_pressure[gproc.pid][proc] += est_time_util
768+
state.worker_time_pressure[gproc.pid][proc] =
769+
get(state.worker_time_pressure[gproc.pid], proc, 0) +
770+
est_time_util
772771
@dagdebug task :schedule "Scheduling to $gproc -> $proc"
773772
@goto pop_task
774773
end

src/sch/util.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ function estimate_task_costs(state, procs, task, inputs)
457457
tx_cost = impute_sum(affinity(chunk)[2] for chunk in chunks_filt)
458458

459459
# Estimate total cost to move data and get task running after currently-scheduled tasks
460-
costs[proc] = state.worker_time_pressure[get_parent(proc).pid][proc] + (tx_cost/tx_rate)
460+
est_time_util = get(state.worker_time_pressure[get_parent(proc).pid], proc, 0)
461+
costs[proc] = est_time_util + (tx_cost/tx_rate)
461462
end
462463

463464
# Shuffle procs around, so equally-costly procs are equally considered

0 commit comments

Comments
 (0)