Skip to content

Commit 3467878

Browse files
authored
Fix unstarted task (#247)
1 parent a48e427 commit 3467878

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: adaptive_scheduler/_executor.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def __init__(
102102
async def _background_check(self) -> None:
103103
"""Periodically check if the task is done."""
104104
while not self.done():
105-
self._get()
105+
if self.executor._run_manager is not None:
106+
self._get()
106107
await asyncio.sleep(1)
107108

108109
def _get(self) -> Any | None: # noqa: PLR0911
@@ -211,7 +212,7 @@ def __init__(self, func: Callable[..., Any]) -> None:
211212
def __call__(self, args: Any) -> Any:
212213
return self.func(*args)
213214

214-
def __getstate__(self) -> dict[str, Any]:
215+
def __getstate__(self) -> bytes:
215216
return cloudpickle.dumps(self.func)
216217

217218
def __setstate__(self, state: bytes) -> None:
@@ -348,7 +349,7 @@ class SlurmExecutor(AdaptiveSchedulerExecutorBase):
348349
kill_manager_kwargs: dict[str, Any] | None = None
349350
loky_start_method: LOKY_START_METHODS = "loky"
350351
cleanup_first: bool = True
351-
save_dataframe: bool = True
352+
save_dataframe: bool = False # `slurm_run` defaults to `True`
352353
dataframe_format: _DATAFRAME_FORMATS = "pickle"
353354
max_log_lines: int = 500
354355
max_fails_per_job: int = 50

0 commit comments

Comments
 (0)