MCPcopy Create free account
hub / github.com/dask/dask / finish_task

Function finish_task

dask/local.py:292–319  ·  view source on GitHub ↗

Update execution state after a task finishes Mutates. This should run atomically (with a lock).

(
    dsk, key, state, results, sortkey, delete=True, release_data=release_data
)

Source from the content-addressed store, hash-verified

290
291
292def finish_task(
293 dsk, key, state, results, sortkey, delete=True, release_data=release_data
294):
295 """
296 Update execution state after a task finishes
297
298 Mutates. This should run atomically (with a lock).
299 """
300 for dep in sorted(state["dependents"][key], key=sortkey, reverse=True):
301 s = state["waiting"][dep]
302 s.remove(key)
303 if not s:
304 del state["waiting"][dep]
305 state["ready"].append(dep)
306
307 for dep in state["dependencies"][key]:
308 if dep in state["waiting_data"]:
309 s = state["waiting_data"][dep]
310 s.remove(key)
311 if not s and dep not in results:
312 release_data(dep, state, delete=delete)
313 elif delete and dep not in results:
314 release_data(dep, state, delete=delete)
315
316 state["finished"].add(key)
317 state["running"].remove(key)
318
319 return state
320
321
322def nested_get(ind, coll):

Callers 2

test_finish_taskFunction · 0.90
get_asyncFunction · 0.85

Calls 3

release_dataFunction · 0.85
removeMethod · 0.80
addMethod · 0.45

Tested by 1

test_finish_taskFunction · 0.72