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

shutdown: terminate subprocesses #619

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Aug 7, 2024

  • We use a subprocess pool for running backgorund commands (e.g. cylc clean).
  • This creates subprocesses to run our commands in, however, it does not kill the subprocess once the command has completed, it keeps the subprocess open for future reuse (more efficient than creating and destroying them every time).
  • On shutdown we need to close the pool to mop up these subprocesses (this doesn't happen automatically).

From experimentation, it would appear that these subprocess do die naturally when run in single-user mode (cylc gui), however, become orphan processes when run in muilti-user mode (cylc hub, tested with sudospawner).

Unfortunately, this does not clean up the dangling subprocesses in multi-user mode due to #392

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added the bug Something isn't working label Aug 7, 2024
@oliver-sanders oliver-sanders added this to the 1.5.1 milestone Aug 7, 2024
@oliver-sanders oliver-sanders self-assigned this Aug 7, 2024
* We use a subprocess pool for running backgorund commands
  (e.g. `cylc clean`).
* This creates subprocesses to run our commands in, however, it does
  not kill the subprocess once the command has completed, it keeps
  the subprocess open for future reuse (more efficient than creating
  and destroying them every time).
* On shutdown we need to close the pool to mop up these subprocesses
  (this doesn't happen automatically).
@oliver-sanders
Copy link
Member Author

CI issues fixed in #620

@MetRonnie
Copy link
Member

Kicking tests

@MetRonnie MetRonnie closed this Aug 9, 2024
@MetRonnie MetRonnie reopened this Aug 9, 2024
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

LGTM, haven't tested

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

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

Tried it out, seems OK

@wxtim wxtim merged commit 3cfed33 into cylc:master Aug 14, 2024
5 of 10 checks passed
@oliver-sanders oliver-sanders deleted the shutdown-subproc-pool branch August 14, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants