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

Implement a "/shutdown" endpoint #771

Closed
shs96c opened this issue Jun 6, 2017 · 8 comments
Closed

Implement a "/shutdown" endpoint #771

shs96c opened this issue Jun 6, 2017 · 8 comments

Comments

@shs96c
Copy link

shs96c commented Jun 6, 2017

With reference to SeleniumHQ/selenium#3978. The ChromeDriver and IEDriverServer both understand a /shutdown endpoint that can be used to quit the service. All the official language bindings attempt to call this URL before killing the service process. It might be nice to also implement this in geckodriver.

@andreastt
Copy link
Contributor

There is no /shutdown endpoint in the specification, and we have /session/{session id}/quit to end the session. I would consider it the responsibility of the parent process to stop geckodriver when it is no longer needed.

@shs96c
Copy link
Author

shs96c commented Jun 7, 2017

/shutdown kills the entire service rather than a single session. It's not in the spec, and the parent processes do kill the geckodriver process.

This endpoint is just how all the language bindings notify the driver service to quit, allowing a controlled shutdown rather than a potential kill -9 That's why I said it might be nice to also implement this is geckodriver :)

@andreastt
Copy link
Contributor

andreastt commented Jun 7, 2017

Ideally a parent process should ask nicely with SIGTERM (15) before using SIGKILL (9). This would be functionally equivalent to having an HTTP endpoint for it.

(Practically we don’t have any special shutdown handling in geckodriver yet because signal handling with Rust is not great yet.)

@shs96c
Copy link
Author

shs96c commented Jun 8, 2017 via email

@jimevans
Copy link

jimevans commented Jun 9, 2017

@andreastt Given that Windows doesn't have SIGTERM and SIGKILL, what's the suggestion for that platform?

@andreastt
Copy link
Contributor

As I said, just terminating geckodriver is absolutely fine. There’s no state in geckodriver that requires cleanup.

@jgraham
Copy link
Member

jgraham commented Jun 23, 2017

If there is a requirement to have an endpoint here it should be in the spec. But an endpoint for this seems like bad design since you probably don't want random clients to shut down the entire service. Instead that can be in control of whoever owns the process using standard os methods for pprocess control. Closing this, but feel free to reopen if there's anything extra we should do here.

@jgraham jgraham closed this as completed Jun 23, 2017
@lock
Copy link

lock bot commented Aug 17, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants