polaris.run.executor.reap_one

polaris.run.executor.reap_one(running: Dict[str, RunningStep]) → StepOutcome[source]

Wait for whichever step finishes next and say how it went.

The scheduler reaps in its own loop rather than giving each running step a thread to wait on it. A thread each is reasonable under subprocess and unsafe here: only the forking thread survives a fork, so a lock held by any other one at that moment is held forever in the child.

Parameters:

running (dict of polaris.run.executor.RunningStep) – The steps currently running, by path

Returns:

outcome (polaris.run.executor.StepOutcome) – What happened to the one that finished