Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.close() interchange process to release more fds #3399

Merged
merged 2 commits into from Apr 26, 2024

Conversation

benclifford
Copy link
Collaborator

@benclifford benclifford commented Apr 25, 2024

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.

Changed Behaviour

As exposed by the changed test, shutdown behaviour is a bit peturbed: for example, situations where executor.shutdown was called multiple times that worked before might no longer work.

Type of change

  • Code maintenance/cleanup

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.
Comment on lines -40 to -43

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change ... ought we go one further and include a fixture that fails if the executor is not shutdown at the end of each test (or perhaps module)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is working towards two fixtures that will fail on threads existing and fds being open...
checking that dfk.cleanup() has been called would be pretty straightforward: that flag already exists in order to try to make dfk.cleanup() idempotent. but not all tests have a dfk... or exactly one dfk...

@benclifford benclifford merged commit 92ad7a7 into master Apr 26, 2024
6 checks passed
@benclifford benclifford deleted the benc-exiting-interchange-close branch April 26, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants