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

RFE: Add a way to run the culler and exit #1

Open
mriedem opened this issue May 4, 2020 · 0 comments
Open

RFE: Add a way to run the culler and exit #1

mriedem opened this issue May 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@mriedem
Copy link
Contributor

mriedem commented May 4, 2020

Proposed change

Currently the script runs until it encounters a keyboard interrupt:

https://github.com/jupyterhub/jupyterhub-idle-culler/blob/v1.0/jupyterhub_idle_culler/__init__.py#L436

Sometimes we disable the hub-managed cull-idle service in our deployment during high load events and run the script manually with just a timeout, i.e. --cull-every is the default of 0.

It would be nice if there was a way to just run the script and let it exit rather than run the IOLoop, especially since there isn't any logging around https://github.com/jupyterhub/jupyterhub-idle-culler/blob/v1.0/jupyterhub_idle_culler/__init__.py#L341 so if that list is empty (there are no users) it appears to just hang and you might not be sure what it's doing.

Alternative options

Alternative is just killing the script when you think it's done, but without more verbose logging to know when each IOLoop is complete that might be hard to know, especially if the culler is running slowly.

Who would use this feature?

Anyone running the culler manually.

(Optional): Suggest a solution

If we don't want to change the behavior of --cull-every=0 then maybe a simple option is supporting --cull-every=-1 to mean exit immediately when done, don't run the IOLoop.

@minrk minrk added the enhancement New feature or request label Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants