Skip to content

[🚀 Feature]: Killing Sessions via UI #11519

Closed
@shmikkil

Description

@shmikkil

Feature and motivation

We are using k8s grid 4 and have the pods up and running all the time. It's a hassle to delete the pods that're stuck when sessions time out or when end-users doesn't close their sessions after the tests were executed. Any way we can add this feature to delete/remove sessions via the UI Console by right-clicking each of these sessions and remove them? Thank You!

Usage example

Right click on individual session IDs that are long running and delete/remove them.
2023-01-06 13_21_14-Selenium Grid

Activity

github-actions

github-actions commented on Jan 6, 2023

@github-actions

@shmikkil, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

diemol

diemol commented on Jan 6, 2023

@diemol
Member

This could make sense. However, I would only enable that feature if the Grid is password protected or under a specific flag. Otherwise, anyone could delete any session and this might be annoying in shared Grids.

Please note that it is only possible to stop idle sessions, if a session is stuck in a request, the request needs to timeout before any action can be taken. You can always tune the session timeout to reduce this type of situation.

added
R-help wantedIssues looking for contributions
and removed
A-needs-triagingA Selenium member will evaluate this soon!
on Jan 6, 2023
github-actions

github-actions commented on Jan 6, 2023

@github-actions

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

shmikkil

shmikkil commented on Jan 6, 2023

@shmikkil
Author

This could make sense. However, I would only enable that feature if the Grid is password protected or under a specific flag. Otherwise, anyone could delete any session and this might be annoying in shared Grids.

Please note that it is only possible to stop idle sessions, if a session is stuck in a request, the request needs to timeout before any action can be taken. You can always tune the session timeout to reduce this type of situation.

Awesome...Glad to hear that! And yes, just going with a default pwd at the moment. Come to think of it, perhaps we should have another enhancement request where there should be an ability for the admins to assign creds to a specific group that could delete/maintain while the end-users who run the tests to be assigned to another group that simply can access the sessions during runtime to view the execution via the UI as well. Would that be helpful?

diemol

diemol commented on Jan 6, 2023

@diemol
Member

This could make sense. However, I would only enable that feature if the Grid is password protected or under a specific flag. Otherwise, anyone could delete any session and this might be annoying in shared Grids.
Please note that it is only possible to stop idle sessions, if a session is stuck in a request, the request needs to timeout before any action can be taken. You can always tune the session timeout to reduce this type of situation.

Awesome...Glad to hear that! And yes, just going with a default pwd at the moment. Come to think of it, perhaps we should have another enhancement request where there should be an ability for the admins to assign creds to a specific group that could delete/maintain while the end-users who run the tests to be assigned to another group that simply can access the sessions during runtime to view the execution via the UI as well. Would that be helpful?

I do not think Grid should start managing user profiles and passwords, that requires storage and managing those credentials very carefully. For now, Grid offers basic auth with a single user and password. That type of feature is out of scope.

shmikkil

shmikkil commented on Jan 6, 2023

@shmikkil
Author

This could make sense. However, I would only enable that feature if the Grid is password protected or under a specific flag. Otherwise, anyone could delete any session and this might be annoying in shared Grids.
Please note that it is only possible to stop idle sessions, if a session is stuck in a request, the request needs to timeout before any action can be taken. You can always tune the session timeout to reduce this type of situation.

Awesome...Glad to hear that! And yes, just going with a default pwd at the moment. Come to think of it, perhaps we should have another enhancement request where there should be an ability for the admins to assign creds to a specific group that could delete/maintain while the end-users who run the tests to be assigned to another group that simply can access the sessions during runtime to view the execution via the UI as well. Would that be helpful?

I do not think Grid should start managing user profiles and passwords, that requires storage and managing those credentials very carefully. For now, Grid offers basic auth with a single user and password. That type of feature is out of scope.

Thanks for the clarification!

krmahadevan

krmahadevan commented on Jan 10, 2023

@krmahadevan
Contributor

@diemol - Basic question around this. If a session is stuck due to whatever reasons (for e.g., the client died/was killed) then wouldn't the session eventually timeout because the guava cache in LocalNode has a listener which seems to be triggering a delete session request for sessions that are about to be evicted.

  • If this cleanup logic is assumed to be reliable (things can still go wrong when we attempted to fire a POST request to delete session) then when would we need this sort of an explicit cleanup ?
  • Even if we were to provide that mechanism (by having the user call the delete session API) would that work because our cleanup would have cleaned up the slot to which this session was associated with ?
diemol

diemol commented on Jan 10, 2023

@diemol
Member

@krmahadevan yes, eventually the timeout will kick in and stop the session.

If this cleanup logic is assumed to be reliable (things can still go wrong when we attempted to fire a POST request to delete session) then when would we need this sort of an explicit cleanup ?

I see as the use case where a session was started with the wrong parameters and you do not want to wait until the timeout kicks in. An Appium session for example.

Even if we were to provide that mechanism (by having the user call the delete session API) would that work because our cleanup would have cleaned up the slot to which this session was associated with ?

The cleanup mechanism for timeout only kicks in when the timeout happens, so this new feature would just be a nice thing to have when one wants to stop the session.

krmahadevan

krmahadevan commented on Jan 10, 2023

@krmahadevan
Contributor

I see as the use case where a session was started with the wrong parameters and you do not want to wait until the timeout kicks in. An Appium session for example.

Ok. In that case, it would just boil down to invoking the DELETE session api (endpoint: /se/grid/node/session/{sessionId}, operation: DELETE) via a curl right ?

diemol

diemol commented on Jan 10, 2023

@diemol
Member

I see as the use case where a session was started with the wrong parameters and you do not want to wait until the timeout kicks in. An Appium session for example.

Ok. In that case, it would just boil down to invoking the DELETE session api (endpoint: /se/grid/node/session/{sessionId}, operation: DELETE) via a curl right ?

That also works. However, the idea would be to have it as an option from the UI (under a flag or so).

shmikkil

shmikkil commented on Feb 22, 2023

@shmikkil
Author

Any update on this enhancement request?

7 remaining items

karanjeetbirdeye

karanjeetbirdeye commented on May 12, 2023

@karanjeetbirdeye

Got it thanks, status endpoint contains the sessionId. Guess I can just parse it and pass it in the api. Thanks a lot.

KrzysztofC

KrzysztofC commented on Dec 21, 2023

@KrzysztofC
added
B-gridEverything grid and server related
on Dec 21, 2023
github-actions

github-actions commented on Sep 26, 2024

@github-actions

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

added
J-staleApplied to issues that become stale, and eventually closed.
and removed
J-staleApplied to issues that become stale, and eventually closed.
on Sep 26, 2024
github-actions

github-actions commented on Mar 31, 2025

@github-actions

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

added
J-staleApplied to issues that become stale, and eventually closed.
on Mar 31, 2025
github-actions

github-actions commented on Apr 14, 2025

@github-actions

This issue was closed because it has been stalled for 14 days with no activity.

removed
J-staleApplied to issues that become stale, and eventually closed.
on Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server relatedI-enhancementSomething could be betterR-help wantedIssues looking for contributions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @krmahadevan@diemol@shmikkil@VietND96@KrzysztofC

      Issue actions

        [🚀 Feature]: Killing Sessions via UI · Issue #11519 · SeleniumHQ/selenium