Skip to content

Commit 5325591

Browse files
authored
Schedule all ready tasks. (#99)
1 parent 54d7b87 commit 5325591

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

docs/source/changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
1919
or processes automatically.
2020
- {pull}`96` handles local paths with remote executors. `PathNode`s are not supported as
2121
dependencies or products (except for return annotations).
22+
- {pull}`99` changes that all tasks that are ready are being scheduled. It improves
23+
interactions with adaptive scaling. {issue}`98` does handle the resulting issues: no
24+
strong adherence to priorities, no pending status.
2225

2326
## 0.4.1 - 2024-01-12
2427

src/pytask_parallel/execute.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,7 @@ def pytask_execute_build(session: Session) -> bool | None: # noqa: C901, PLR091
6363
while session.scheduler.is_active():
6464
try:
6565
newly_collected_reports = []
66-
n_new_tasks = session.config["n_workers"] - len(running_tasks)
67-
68-
ready_tasks = (
69-
list(session.scheduler.get_ready(n_new_tasks))
70-
if n_new_tasks >= 1
71-
else []
72-
)
66+
ready_tasks = list(session.scheduler.get_ready(10_000))
7367

7468
for task_name in ready_tasks:
7569
task = session.dag.nodes[task_name]["task"]

tests/test_execute.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def task_2(path: Annotated[Path, Product] = Path("out_2.txt")):
7878

7979

8080
@pytest.mark.end_to_end()
81+
@pytest.mark.skip(reason="See #98")
8182
@pytest.mark.parametrize("parallel_backend", _IMPLEMENTED_BACKENDS)
8283
def test_stop_execution_when_max_failures_is_reached(tmp_path, parallel_backend):
8384
source = """
@@ -106,6 +107,7 @@ def task_3(): time.sleep(3)
106107

107108

108109
@pytest.mark.end_to_end()
110+
@pytest.mark.skip(reason="See #98")
109111
@pytest.mark.parametrize("parallel_backend", _IMPLEMENTED_BACKENDS)
110112
def test_task_priorities(tmp_path, parallel_backend):
111113
source = """

0 commit comments

Comments
 (0)