Skip to content

Commit

Permalink
.close() interchange process to release more fds (#3399)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
benclifford committed Apr 26, 2024
1 parent 7d5ce86 commit 92ad7a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions parsl/executors/high_throughput/executor.py
Expand Up @@ -819,6 +819,8 @@ def shutdown(self, timeout: float = 10.0):
logger.info("Unable to terminate Interchange process; sending SIGKILL")
self.interchange_proc.kill()

self.interchange_proc.close()

logger.info("Finished HighThroughputExecutor shutdown attempt")

def get_usage_information(self):
Expand Down
4 changes: 0 additions & 4 deletions parsl/tests/test_htex/test_missing_worker.py
Expand Up @@ -37,7 +37,3 @@ def test_that_it_fails():
raise Exception("The app somehow ran without a valid worker")

assert parsl.dfk().config.executors[0]._executor_bad_state.is_set()

# htex needs shutting down explicitly because dfk.cleanup() will not
# do that, as it is in bad state
parsl.dfk().config.executors[0].shutdown()

0 comments on commit 92ad7a7

Please sign in to comment.