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_all_sessions() #963

Open
aeddins-ibm opened this issue Jul 19, 2023 · 4 comments
Open

close_all_sessions() #963

aeddins-ibm opened this issue Jul 19, 2023 · 4 comments
Labels
enhancement New feature or request priority: medium Medium Priority issue (must have for current release) server action Need actions from the server side

Comments

@aeddins-ibm
Copy link

What is the expected feature or enhancement?
A method that closes any currently open sessions.

For example, say I am developing code that involves submitting jobs in a session. I run the code and it starts submitting jobs. Then I notice a bug in my code, so I hit ctrl+C to interrupt, fix the bug, then restart. If I understand correctly, a new session is created, but the old session is still running and I cannot close it since I do not have access to it. Instead, I have to wait for some timeout condition to automatically kill the old session before my new session can start running jobs (is this correct?).

If the above is an accurate description of the situation, then if I could call service.close_all_sessions(), I would not have to wait for this timeout condition. More generally, it would also be nice to have access to something like service.open_sessions() so I can see a list of what sessions I have open (and potentially close unneeded ones).

@aeddins-ibm aeddins-ibm added the enhancement New feature or request label Jul 19, 2023
@nonhermitian
Copy link
Contributor

nonhermitian commented Jul 20, 2023

I second this. Perhaps with an optional filter for a specific backend.

@jyu00 jyu00 added the priority: medium Medium Priority issue (must have for current release) label Aug 7, 2023
@aeddins-ibm
Copy link
Author

I've been using Runtime pretty regularly for the past few weeks. A more common case where this can come up is when you run a cell in a Jupyter notebook like:

session = Session(...)
[run the jobs]

The jobs run, and based on the data (or errors 😅) you get back, you want to make a small tweak and try again. So you run the cell again. But (if I understand correctly) it can't run the jobs yet because the old session is still open. And the line session = Session(...) has erased your reference to the old session, so you can't close it. So now you have to wait around for 5 minutes until the old session times out. In this situation, a way to close the old session could be very helpful.

@jyu00
Copy link
Collaborator

jyu00 commented Aug 29, 2023

I agree this would be a nice feature. Probably will need to wait for #887 first though, so we know which sessions are actually active.

@samanthavbarron
Copy link
Collaborator

Seconding this as a good feature to have

@jyu00 jyu00 added the server action Need actions from the server side label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: medium Medium Priority issue (must have for current release) server action Need actions from the server side
Projects
None yet
Development

No branches or pull requests

4 participants