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
cli: cockroach quit
should wait until the server has effectively stopped
#6585
Comments
I believe this was fixed by #7483. |
No, not fixed yet. Technically |
Could make |
But the stream would always close slightly before the process (pid) On Fri, Jul 1, 2016 at 10:28 PM Tamir Duberstein notifications@github.com
-- Tobias |
Yeah, but that's the best we're ever going to do, right? |
No that's not the best. You can also use the syscall kill(2) with SIGCONT or some other innocuous signal until your kernel tells you the process does not exist any more. That's the best way. |
Doesn't that assume that the cli process is on the same machine as the server? |
Well ok if it isn't then what you said is the best. But it local control not the common case? |
Most software doesn't have an equivalent command (and I consider our Without a process manager, it's difficult to manage the full lifecycle precisely. You can either start with If Go supported |
As I explain in #7603 (comment) you can also count on the server's OS to signal process termination by shutting down all open sockets. That is detectable over the network. |
Scripts like e.g. the Jepsen tests will start and then restart a server. Now if the following commands are issued quickly in sequence:
then the 3rd sometimes fails with an error "the server is already started". This is because "quit" merely issues a termination request and terminates (and gives control back to the shell) before the db server has effectively terminated.
Script writers need a way to synchronize on the termination of the db server. The easiest way forward would be to have "quit" wait until the shutdown request has been processed and the connection to the server is lost.
Reported by @dationl.
The text was updated successfully, but these errors were encountered: