cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua McKenzie (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-14464) stop-server.bat -p ../pid.txt -f command not working on windows 2016
Date Sat, 02 Jun 2018 13:56:00 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-14464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499077#comment-16499077
] 

Joshua McKenzie edited comment on CASSANDRA-14464 at 6/2/18 1:55 PM:
---------------------------------------------------------------------

When you run with -f, you're getting a simple:
{quote}taskkill /f /pid $pidToKill
{quote}
So seems like there's something odd happening on your system if it's restarting cassandra
after being force-killed by the OS. So first off, I'd recommend not running with /f since
that's basically forcing a hard stop of the DB w/out letting it shutdown gracefully.

To give some context here on the surprising complexity of C* shutdown on windows: this code
was written in July of 2014, and [does the following|[https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L75-L95]])
:
 # A .bat file calls
 # A powershell file which
 # Contains a C# program it interprets on the fly ([PowerStopper.Stopper|https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L69-L71])
which
 # Uses pinvoke to use [native calls|https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L120-L140]
to attach to the console and send a ctrl+C to kill it and let the C*/JVM signal handlers terminate
the application

The TL;DR here: it's kind of a small miracle it worked in the first place (Windows signal
handling very very very much != *nix), and if your two OS environments are respawning a
process that terminated itself due to receiving a SIGINT and shutting down, there's not much
we can do from a runtime script perspective to stop it.

That being said, I tested the functionality of this on server 2012 back when I wrote it and
it worked fine on a few different environments and used it for dev purposes daily for a couple
years after that on Win10 and Server 2012 for a couple years after that without ever having
an issue with it.

The new pid that gets spawned is another java process running C*? If you run process explorer,
what parent process owns that new pid? Is it owned by the original cassandra.bat that you
were running things from? Is it running as a service under svchost?

 

 


was (Author: joshuamckenzie):
When you run with -f, you're getting a simple:
{quote}taskkill /f /pid $pidToKill{quote}
So seems like there's something odd happening on your system if it's restarting cassandra
after being force-killed by the OS. So first off, I'd recommend not running with /f since
that's basically forcing a hard stop of the DB w/out letting it shutdown gracefully.

To give some context here on the surprising complexity of C* shutdown on windows: this code
was written in July of 2014, and [does the following|[https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L75-L95]|https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L75-L95]:])
:
 # A .bat file calls
 # A powershell file which
 # Contains a C# program it interprets on the fly ([PowerStopper.Stopper|https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L69-L71])
which
 # Uses pinvoke to use [native calls|https://github.com/apache/cassandra/blob/cassandra-3.11/bin/stop-server.ps1#L120-L140]
to attach to the console and send a ctrl+C to kill it and let the C*/JVM signal handlers terminate
the application

The TL;DR here: it's kind of a small miracle it worked in the first place (Windows signal
handling very very very much != *nix), and if your two OS environments are respawning a
process that terminated itself due to receiving a SIGINT and shutting down, there's not much
we can do from a runtime script perspective to stop it.

That being said, I tested the functionality of this on server 2012 back when I wrote it and
it worked fine on a few different environments and used it for dev purposes daily for a couple
years after that on Win10 and Server 2012 for a couple years after that without ever having
an issue with it.

The new pid that gets spawned is another java process running C*? If you run process explorer,
what parent process owns that new pid? Is it owned by the original cassandra.bat that you
were running things from? Is it running as a service under svchost?

 

 

> stop-server.bat -p ../pid.txt -f command not working on windows 2016
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-14464
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14464
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Shyam Phirke
>            Priority: Critical
>
> Steps to reproduce:
> 1. Copy and extract cassandra binaries on windows 2016 machine
> 2. Start cassandra in non-legacy mode
> 3. Check pid of cassandra in task manager and compare it with in pid.txt
> 4. Now stop cassandra using command stop-server.bat -p ../pid.txt -f
> Expected:
> After executing <cassandra_installed_location>\bin:\> stop-server.bat -p ../pid.txt
-f
> cassandra process as in pid.txt should get killed.
>  
> Actual:
> After executing above stop command, the cassandra process as in pid.txt gets killed but
a new process gets created with new pid. Also the pid.txt not updated with new pid.
> This new process should not get created.
>  
> Please comment on this issue if more details required.
> I am using cassandra 3.11.2.
>  
> This issue impacting me much since because of this new process getting created my application
uninstallation getting impacted.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message