You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Ted Dunning (JIRA)" <ji...@apache.org> on 2011/05/10 22:38:47 UTC
[jira] [Created] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Zookeeper stop fails if start called twice
------------------------------------------
Key: ZOOKEEPER-1061
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
Project: ZooKeeper
Issue Type: Bug
Components: scripts
Affects Versions: 3.3.2
Reporter: Ted Dunning
Fix For: 3.3.3
The zkServer.sh script doesn't check properly to see if a previously started
server is still running. If you call start twice, the second invocation
will over-write the PID file with a process that then fails due to port
occupancy.
This means that stop will subsequently fail.
Here is a reference that describes how init scripts should normally work:
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033178#comment-13033178 ]
Ted Dunning commented on ZOOKEEPER-1061:
----------------------------------------
Any hope for a commit on this?
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032561#comment-13032561 ]
Mahadev konar commented on ZOOKEEPER-1061:
------------------------------------------
thats good to have!
love this change though :) :
{noformat}
-dataDir=/export/crawlspace/mahadev/zookeeper/server1/data
+dataDir=/home/tdunning/tmp
{noformat}
Other than that +1 for the change!
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031393#comment-13031393 ]
Hadoop QA commented on ZOOKEEPER-1061:
--------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12478734/ZOOKEEPER-1061.patch
against trunk revision 1099329.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no new tests are needed for this patch.
Also please list what manual steps were performed to verify this patch.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/256//testReport/
Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/256//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/256//console
This message is automatically generated.
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032648#comment-13032648 ]
Ted Dunning commented on ZOOKEEPER-1061:
----------------------------------------
Ouch. Our internal review caught that after I pushed out the patch.
I was kind of hoping nobody else would notice.
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13034704#comment-13034704 ]
Hudson commented on ZOOKEEPER-1061:
-----------------------------------
Integrated in ZooKeeper-trunk #1185 (See [https://builds.apache.org/hudson/job/ZooKeeper-trunk/1185/])
ZOOKEEPER-1061. Zookeeper stop fails if start called twice. (Ted Dunning via mahadev)
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13033183#comment-13033183 ]
Mahadev konar commented on ZOOKEEPER-1061:
------------------------------------------
ted, ill commit this tonight (latest over the weekend). Need to run some tests manually and will also fix the datadir conf change to point to just /tmp/zookeeper.
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031401#comment-13031401 ]
Ted Dunning commented on ZOOKEEPER-1061:
----------------------------------------
No unit tests are reasonably for these script-only changes. Here is a manual
test. Without the fix, we see this mal-behavior:
{code}
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ...
STARTED
tdunning@ted-desk:~/Apache/zookeeper$ sudo jps
17610 QuorumPeerMain
17646 Jps
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ...
STARTED
tdunning@ted-desk:~/Apache/zookeeper$ sudo jps
17685 Jps
17610 QuorumPeerMain
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh stop
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Stopping zookeeper ...
kill: 160: No such process
STOPPED
tdunning@ted-desk:~/Apache/zookeeper$ sudo jps
17730 Jps
17610 QuorumPeerMain
{code}
With the fix, I get this.
{code}
tdunning@ted-desk:~/Apache/zookeeper$ patch < ZOOKEEPER-1061.patch
patching file zkServer.sh
# first start works
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... STARTED
# second start fails with good message
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... already running as process 17928.
# and this is persistent behavior
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... already running as process 17928.
# stop now works
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh stop
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Stopping zookeeper ... STOPPED
# repeated stop works correctly
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh stop
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Stopping zookeeper ... error: could not find file /var/zookeeper/zookeeper_server.pid
# and start works again
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... STARTED
# but can't be repeated
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... already running as process 18155.
# running without proper permissions gives a different error
tdunning@ted-desk:~/Apache/zookeeper$ bin/zkServer.sh start
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Starting zookeeper ... bin/zkServer.sh: 169: cannot create /var/zookeeper/zookeeper_server.pid: Permission denied
FAILED TO WRITE PID
tdunning@ted-desk:~/Apache/zookeeper$ sudo bin/zkServer.sh stop
JMX enabled by default
Using config: /etc/zookeeper/zoo.cfg
Stopping zookeeper ... STOPPED
{code}
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3, 3.4.0
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Dunning reassigned ZOOKEEPER-1061:
--------------------------------------
Assignee: Ted Dunning
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (ZOOKEEPER-1061) Zookeeper stop fails if start
called twice
Posted by "Ted Dunning (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-1061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Dunning updated ZOOKEEPER-1061:
-----------------------------------
Attachment: ZOOKEEPER-1061.patch
Here is a patch that handles the double start and fixes up some exit values.
> Zookeeper stop fails if start called twice
> ------------------------------------------
>
> Key: ZOOKEEPER-1061
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1061
> Project: ZooKeeper
> Issue Type: Bug
> Components: scripts
> Affects Versions: 3.3.2
> Reporter: Ted Dunning
> Assignee: Ted Dunning
> Fix For: 3.3.3
>
> Attachments: ZOOKEEPER-1061.patch
>
>
> The zkServer.sh script doesn't check properly to see if a previously started
> server is still running. If you call start twice, the second invocation
> will over-write the PID file with a process that then fails due to port
> occupancy.
> This means that stop will subsequently fail.
> Here is a reference that describes how init scripts should normally work:
> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira