[jira] [Comment Edited] (CASSANDRA-8738) "/etc/init.d/cassandra stop" prints OK even when it doesn't work
[ https://issues.apache.org/jira/browse/CASSANDRA-8738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16328854#comment-16328854 ] Bhargav edited comment on CASSANDRA-8738 at 1/17/18 3:05 PM: - Hi, I'm using Apache Cassandra 3.0.13 version. I'm facing a problem when stopping Cassandra service. when stopping Cassandra service,it is not stopping and process is still running in the background. !screenshot-1.png! it is throwing a error message in log as below. !screenshot-2.png! My Cassandra service stop script in /etc/rc.d/init.d/cassandra file is as below. !screenshot-3.png! please let me know if any of you had faced the same problem and what is the cause for this issue. Thanks in advance!! Bhargav. was (Author: bmokkapa): Hi, I'm using Apache Cassandra 3.0.13 version. I'm facing a problem when stopping Cassandra service. when stopping Cassandra service,it is not stopping and process is still running in the background. !screenshot-1.png! it is throwing a error message in log as below. !screenshot-2.png! My Cassandra service stop script in /etc/rc.d/init.d/cassandra file is as below. !screenshot-3.png! please let me know if any of you had faced the same problem and what is the cause for this issue. Thanks in advance!! Bhargav. > "/etc/init.d/cassandra stop" prints OK even when it doesn't work > > > Key: CASSANDRA-8738 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8738 > Project: Cassandra > Issue Type: Improvement >Reporter: Donald Smith >Priority: Major > Attachments: screenshot-1.png, screenshot-2.png, screenshot-3.png > > > Sometimes I do {{/etc/init.d/cassandra stop}} and it prints out OK, but the > server is still running. (This happens, for example, if it's busy doing > GCs.) The current init script prints out OK after sleeping but without > checking if the process really stopped. I suggest changing it to: > {noformat} > pd0-cassandra16 ~> diff -C 1 cassandra cassandra-original > *** cassandra 2015-02-04 09:15:58.088209988 -0800 > --- cassandra-original 2015-02-04 09:15:40.293767501 -0800 > *** > *** 69,77 > sleep 5 > ! THE_STATUS=`$0 status` > ! if [[ $THE_STATUS == *"stopped"* ]] > ! then > !echo "OK" > ! else > !echo "ERROR: could not stop the process: $THE_STATUS" > !exit 1 > ! fi > ;; > --- 69,71 > sleep 5 > ! echo "OK" > ;; > {noformat} > Then it prints out OK only if the stop succeeded. Otherwise it prints out a > message like > {quote} > ERROR: could not stop the process: cassandra (pid 10764) is running... > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org
[jira] [Comment Edited] (CASSANDRA-8738) /etc/init.d/cassandra stop prints OK even when it doesn't work
[ https://issues.apache.org/jira/browse/CASSANDRA-8738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14305548#comment-14305548 ] Donald Smith edited comment on CASSANDRA-8738 at 2/4/15 5:36 PM: - Here's the change in context: {noformat} stop) # Cassandra shutdown echo -n Shutdown Cassandra: su $CASSANDRA_OWNR -c kill `cat $pid_file` for t in `seq 40`; do $0 status /dev/null 21 sleep 0.5 || break; done # Adding a sleep here to give jmx time to wind down (CASSANDRA-4483). Not ideal... # Adam Holmberg suggests this, but that would break if the jmx port is changed # for t in `seq 40`; do netstat -tnlp | grep 0.0.0.0:7199 /dev/null 21 sleep 0.1 || break; done sleep 5 THE_STATUS=`$0 status` if [[ $THE_STATUS == *stopped* ]] then echo OK else echo ERROR: could not stop the process: $THE_STATUS exit 1 fi ;; {noformat} was (Author: thinkerfeeler): Here's the change in context: {noformat} stop) # Cassandra shutdown echo -n Shutdown Cassandra: su $CASSANDRA_OWNR -c kill `cat $pid_file` for t in `seq 40`; do $0 status /dev/null 21 sleep 0.5 || break; done # Adding a sleep here to give jmx time to wind down (CASSANDRA-4483). Not ideal... # Adam Holmberg suggests this, but that would break if the jmx port is changed # for t in `seq 40`; do netstat -tnlp | grep 0.0.0.0:7199 /dev/null 21 sleep 0.1 || break; done sleep 5 THE_STATUS=`$0 status` if [[ $THE_STATUS == *stopped* ]] then echo OK else echo ERROR: could not stop the process: $THE_STATUS fi ;; {noformat} /etc/init.d/cassandra stop prints OK even when it doesn't work Key: CASSANDRA-8738 URL: https://issues.apache.org/jira/browse/CASSANDRA-8738 Project: Cassandra Issue Type: Improvement Reporter: Donald Smith Sometimes I do {{/etc/init.d/cassandra stop}} and it prints out OK, but the server is still running. (This happens, for example, if it's busy doing GCs.) The current init script prints out OK after sleeping but without checking if the process really stopped. I suggest changing it to: {noformat} pd0-cassandra16 ~ diff -C 1 cassandra cassandra-original *** cassandra 2015-02-04 09:15:58.088209988 -0800 --- cassandra-original 2015-02-04 09:15:40.293767501 -0800 *** *** 69,77 sleep 5 ! THE_STATUS=`$0 status` ! if [[ $THE_STATUS == *stopped* ]] ! then !echo OK ! else !echo ERROR: could not stop the process: $THE_STATUS !exit 1 ! fi ;; --- 69,71 sleep 5 ! echo OK ;; {noformat} Then it prints out OK only if the stop succeeded. Otherwise it prints out a message like {quote} ERROR: could not stop the process: cassandra (pid 10764) is running... {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)