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

Function finish_task

dask/local.py:290–317  ·  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

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