-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move ManagerLost and VersionMismatch to errors.py
Per the analysis in #3495, defining the `ManagerLost` and `VersionMismatch` errors in the `interchange.py` became a problem in #3463, where the interchange now runs as `__main__`. This makes it difficult for Dill to get the serde correct. The organizational fix is simply to move these classes to an importable location, which follows the expectation that classes are available in both local and remote locations, which defining in `__main__` can't easily guarantee. Fixes: #3495
- Loading branch information
1 parent
a128fdc
commit 10c1b3a
Showing
3 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
parsl/tests/test_serialization/test_3495_deserialize_managerlost.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import os | ||
import signal | ||
|
||
import pytest | ||
|
||
import parsl | ||
from parsl import Config, HighThroughputExecutor | ||
|
||
|
||
@parsl.python_app | ||
def get_manager_pgid(): | ||
import os | ||
return os.getpgid(os.getpid()) | ||
|
||
|
||
@parsl.python_app | ||
def lose_manager(): | ||
import os | ||
import signal | ||
|
||
manager_pid = os.getppid() | ||
os.kill(manager_pid, signal.SIGSTOP) | ||
|
||
|
||
@pytest.mark.local | ||
def test_manager_lost_system_failure(tmpd_cwd): | ||
hte = HighThroughputExecutor( | ||
label="htex_local", | ||
address="127.0.0.1", | ||
max_workers_per_node=2, | ||
cores_per_worker=1, | ||
worker_logdir_root=str(tmpd_cwd), | ||
heartbeat_period=1, | ||
heartbeat_threshold=1, | ||
) | ||
c = Config(executors=[hte], strategy='simple', strategy_period=0.1) | ||
|
||
with parsl.load(c): | ||
manager_pgid = get_manager_pgid().result() | ||
try: | ||
lose_manager().result() | ||
except Exception as e: | ||
assert "ManagerLost" not in str(e), f"Issue 3495: {e}" | ||
finally: | ||
# Allow process to clean itself up | ||
os.killpg(manager_pgid, signal.SIGCONT) | ||
os.killpg(manager_pgid, signal.SIGTERM) |