Skip to content

Commit 92ad7a7

Browse files
authored
.close() interchange process to release more fds (#3399)
This releases two fds in the workflow process used to communicate with the interchange process, and is part of work to release more resources explicitly at shutdown rather than leaving them until process end. One test was making an out-of-API shutdown of HTEX on the basis that the DFK would not shutdown this executor when a bad state was set. That used to be true, but PR 2855, which re-arranged some shutdown behaviour, (accidentally?) changed shutdown to always happen. That is, I think, the right shutdown behaviour: if an executor wants to suppress parts of its own shutdown based on internal state, that's the business of the executor, not the DFK. This PR removes that out-of-API shutdown.
1 parent 7d5ce86 commit 92ad7a7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

parsl/executors/high_throughput/executor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ def shutdown(self, timeout: float = 10.0):
819819
logger.info("Unable to terminate Interchange process; sending SIGKILL")
820820
self.interchange_proc.kill()
821821

822+
self.interchange_proc.close()
823+
822824
logger.info("Finished HighThroughputExecutor shutdown attempt")
823825

824826
def get_usage_information(self):

parsl/tests/test_htex/test_missing_worker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,3 @@ def test_that_it_fails():
3737
raise Exception("The app somehow ran without a valid worker")
3838

3939
assert parsl.dfk().config.executors[0]._executor_bad_state.is_set()
40-
41-
# htex needs shutting down explicitly because dfk.cleanup() will not
42-
# do that, as it is in bad state
43-
parsl.dfk().config.executors[0].shutdown()

0 commit comments

Comments
 (0)