diff --git a/.binder/environment.yml b/.binder/environment.yml index 3e15ee1a..7f173c37 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -4,7 +4,7 @@ dependencies: - bagofholding =0.1.9 - bidict =0.23.1 - cloudpickle =3.1.2 -- executorlib =1.8.0 +- executorlib =1.9.1 - graphviz =9.0.0 - hatchling =1.28.0 - hatch-vcs =0.5.0 diff --git a/.ci_support/environment.yml b/.ci_support/environment.yml index 3e15ee1a..7f173c37 100644 --- a/.ci_support/environment.yml +++ b/.ci_support/environment.yml @@ -4,7 +4,7 @@ dependencies: - bagofholding =0.1.9 - bidict =0.23.1 - cloudpickle =3.1.2 -- executorlib =1.8.0 +- executorlib =1.9.1 - graphviz =9.0.0 - hatchling =1.28.0 - hatch-vcs =0.5.0 diff --git a/docs/environment.yml b/docs/environment.yml index 05f6aa16..54c904cb 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -10,7 +10,7 @@ dependencies: - bagofholding =0.1.9 - bidict =0.23.1 - cloudpickle =3.1.2 -- executorlib =1.8.0 +- executorlib =1.9.1 - graphviz =9.0.0 - hatchling =1.28.0 - hatch-vcs =0.5.0 diff --git a/pyiron_workflow/mixin/run.py b/pyiron_workflow/mixin/run.py index 8f70fef5..8eca81a4 100644 --- a/pyiron_workflow/mixin/run.py +++ b/pyiron_workflow/mixin/run.py @@ -6,6 +6,7 @@ from __future__ import annotations import contextlib +import threading from abc import ABC, abstractmethod from collections.abc import Callable from concurrent.futures import Executor as StdLibExecutor @@ -344,8 +345,14 @@ def _finish_run( run_output = run_output.result() self.future = None if unique_executor: - unique_executor.shutdown(wait=False) - del unique_executor + # executorlib-1.8.2+ cancels futures on `shutdown` + # To avoid recursively invoking this callback, delay shutdown + # until the callback is complete. + threading.Thread( + target=unique_executor.shutdown, + kwargs={"wait": True}, + daemon=True, + ).start() return self.process_run_result(run_output) except Exception as e: self._run_exception(**run_exception_kwargs) diff --git a/pyproject.toml b/pyproject.toml index d471d54d..769acd83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "bagofholding==0.1.9", "bidict==0.23.1", "cloudpickle==3.1.2", - "executorlib==1.8.0", + "executorlib==1.9.1", "graphviz==0.21", "pandas==3.0.0", "pint==0.25",