ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitro Lisnichenko" <dlysniche...@hortonworks.com>
Subject Review Request 27682: Services fail to start when pid file is empty
Date Thu, 06 Nov 2014 16:27:05 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27682/
-----------------------------------------------------------

Review request for Ambari and Vitalyi Brodetskyi.


Bugs: AMBARI-8185
    https://issues.apache.org/jira/browse/AMBARI-8185


Repository: ambari


Description
-------

Witnessed at a customer site:
Storm Supervisor server had a pid file at /var/run/storm/supervisor.pid
This file, while present, had no content
The stack file, service.py detects a running process using this call:
  no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}`
>/dev/null 2>&1")
When the file is empty, this command returns 0 (success), and the startup command does not
run.
Changed the command to
  no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}`
>/dev/null 2>&1")
which returns properly that the process is not running and startup can continue.
The customer reports that they have seen this behavior with other services, but could not
reproduce on-site. This pattern is used frequently through the code base and should be addressed
for all services including Storm. Validation of this change is the critical task here since
the change is "small" - the effects are large in scope.
Also, at ambari/ambari-agent/conf/unix/ambari-agent we have few invocations of a similar code
with another bug:
          PID=`cat $PIDFILE`
          echo "Found $AMBARI_AGENT PID: $PID"
          if [ -z "`ps ax -o pid | grep $PID`" ]; then
Here if $PID is for example 2111 and there is a running process with pid like 22111, we will
get a false positive (agent will refuse to start saying it is already running).


Diffs
-----

  ambari-agent/conf/unix/ambari-agent e867155 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/package/scripts/hbase_service.py
723d4e2 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/service_check.py
bc3961c 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/scripts/utils.py
f1f0ac4 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/scripts/hive_service.py
8507816 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/package/scripts/oozie.py
d390c69 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/package/scripts/oozie_service.py
78661b0 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/WEBHCAT/package/scripts/webhcat_service.py
a92446d 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/package/scripts/service.py
42a7138 
  ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/ZOOKEEPER/package/scripts/zookeeper_service.py
d642bc6 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_service.py
045a7b9 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/service_check.py
203fc55 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/utils.py
6e9cb21 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hive_service.py
d3bd71b 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/webhcat_service.py
99c49a6 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/service.py
cb885e0 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py
af06efc 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie_service.py
1aa44fb 
  ambari-server/src/main/resources/stacks/HDP/1.3.2/services/ZOOKEEPER/package/scripts/zookeeper_service.py
d642bc6 
  ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/package/scripts/service.py
d854565 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HBASE/package/scripts/hbase_service.py
723d4e2 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/service_check.py
36e26d6 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/utils.py
14251cd 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hive_service.py
294121d 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/webhcat_service.py
41fb529 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
8f06a3d 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
ac4280a 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service.py
7250835 
  ambari-server/src/main/resources/stacks/HDP/2.0.6/services/ZOOKEEPER/package/scripts/zookeeper_service.py
d642bc6 
  ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/package/scripts/service.py
464f62e 
  ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/service.py
d854565 
  ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/service.py
9dc42b9 
  ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka_broker.py
77c6b8b 
  ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/package/scripts/knox_gateway.py
fe4c8b1 
  ambari-server/src/test/python/stacks/1.3.2/HBASE/test_hbase_master.py cb1a81d 
  ambari-server/src/test/python/stacks/1.3.2/HBASE/test_hbase_regionserver.py 88570d5 
  ambari-server/src/test/python/stacks/1.3.2/HDFS/test_datanode.py 845476f 
  ambari-server/src/test/python/stacks/1.3.2/HDFS/test_namenode.py 83ca3d7 
  ambari-server/src/test/python/stacks/1.3.2/HDFS/test_snamenode.py e801dba 
  ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py 006dd90 
  ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_server.py 4dceec1 
  ambari-server/src/test/python/stacks/1.3.2/HIVE/test_webhcat_server.py 75496c2 
  ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_historyserver.py bceb92f

  ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py 2430d93

  ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_tasktracker.py 15a598b

  ambari-server/src/test/python/stacks/1.3.2/OOZIE/test_oozie_server.py 13e1fdc 
  ambari-server/src/test/python/stacks/1.3.2/ZOOKEEPER/test_zookeeper_server.py 41c2648 
  ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py 856dd9a 
  ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_regionserver.py c705fbd 
  ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py b5b230d 
  ambari-server/src/test/python/stacks/2.0.6/HDFS/test_journalnode.py a91d130 
  ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py c436646 
  ambari-server/src/test/python/stacks/2.0.6/HDFS/test_snamenode.py bc94f8a 
  ambari-server/src/test/python/stacks/2.0.6/HDFS/test_zkfc.py 4bcd104 
  ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py 887c8d3 
  ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py 581b4d3 
  ambari-server/src/test/python/stacks/2.0.6/HIVE/test_webhcat_server.py d2caa8b 
  ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py 9bf2085 
  ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py 050b3e6 
  ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b70c9e5 
  ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py 6f7f286 
  ambari-server/src/test/python/stacks/2.0.6/ZOOKEEPER/test_zookeeper_server.py d839abe 
  ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b65c28e 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py 189b874 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_nimbus.py 90c52a1 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_rest_api_service.py b502859 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor.py 806394b 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_supervisor_prod.py eb01146 
  ambari-server/src/test/python/stacks/2.1/STORM/test_storm_ui_server.py 365d926 
  ambari-server/src/test/python/stacks/2.1/YARN/test_apptimelineserver.py 0239cf3 

Diff: https://reviews.apache.org/r/27682/diff/


Testing
-------

----------------------------------------------------------------------
Ran 243 tests in 3.272s

OK
----------------------------------------------------------------------
Total run:684
Total errors:0
Total failures:0
OK


Thanks,

Dmitro Lisnichenko


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message