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

Started processes should be killed on SIGINT #7

Closed
marianogappa opened this issue May 20, 2017 · 6 comments
Closed

Started processes should be killed on SIGINT #7

marianogappa opened this issue May 20, 2017 · 6 comments

Comments

@marianogappa
Copy link
Owner

No description provided.

@therealplato
Copy link
Contributor

https://github.com/marianogappa/sql/pull/9/files

@marianogappa
Copy link
Owner Author

This is very good stuff! Tests show that even though the ssh processes are indeed killed, the queries on the remote server are not killed. Unfortunately, that detail makes the feature less than ideal. Let's spend a little more time to see if we can change ssh's behaviour on termination. Perhaps a different termination signal does the job.

@marianogappa
Copy link
Owner Author

I'll merge it and then start testing with ssh -t -t to see if the remote mysql processes are terminated.

@marianogappa
Copy link
Owner Author

It was more complicated than we thought. This is a very insightful response: https://serverfault.com/questions/463366/does-getting-disconnected-from-an-ssh-session-kill-your-programs/463375#463375?newreg=262ab662145f48e6b09d66fe21310cae

The mysql client process will terminate shortly. That doesn't mean at all that the mysql server will abort the query. We can look into a configuration in the mysql client exec call to make it abort queries on HUP, but there is nothing we can do from the ssh command.

@marianogappa
Copy link
Owner Author

Also I discovered today we can use the SLEEP(seconds) function on MariaDB to test this!

MariaDB [test]> select sleep(10);

10 seconds later…

+-----------+
| sleep(10) |
+-----------+
|         0 |
+-----------+

@marianogappa
Copy link
Owner Author

I'm afraid this is a limitation of the mysql client; I can validate the queries still live on the server until they finish. Research only points to using SHOW PROCESSLIST + KILL 1234. We can revise this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants