Merge lp:~ben-kaehne/charms/trusty/rabbitmq-server/statsfix into lp:charms/trusty/rabbitmq-server

Proposed by Benjamin Kaehne
Status: Rejected
Rejected by: Ryan Beisner
Proposed branch: lp:~ben-kaehne/charms/trusty/rabbitmq-server/statsfix
Merge into: lp:charms/trusty/rabbitmq-server
Diff against target: 32 lines (+8/-4)
1 file modified
scripts/collect_rabbitmq_stats.sh (+8/-4)
To merge this branch: bzr merge lp:~ben-kaehne/charms/trusty/rabbitmq-server/statsfix
Reviewer Review Type Date Requested Status
Andrew McLeod (community) Needs Fixing
Ryan Beisner (community) Needs Resubmitting
Review Queue (community) automated testing Needs Fixing
Review via email: mp+290949@code.launchpad.net

Description of the change

Modifying the stats collections script to use a temporary staging file to write to prior to making stats available in a known file.

This is to eliminate race conditions with scripts which may be reading this file.

To post a comment you must log in.
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/3531/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/3481/

review: Needs Fixing (automated testing)
Revision history for this message
Ryan Beisner (1chb1n) wrote :

Apologies for the delay on your merge proposal review. Thank you for your work on this.

The rabbitmq-server charm development moved to a Git/Gerrit flow [1] in Feb 2016. The launchpad repos are effectively now read-only. There is a temporary sync in place from git to LP, but those LP locations will be removed as soon as deployment and test automation and tooling surrounding this charm are confirmed to no longer be dependent on the LP branches.

Please see the announcement and the development process [2], then re-propose these changes against "openstack/charm-rabbitmq-server" via the new process.

Also note that the true source of truth for this charm is in OpenStack's cgit [3], but that those changes are sync'd to github [4] in near-real-time. One can git clone either, then follow the same dev process [2] as OpenStack to propose the change.

Thanks again.

[1] https://lists.ubuntu.com/archives/juju/2016-February/006606.html
[2] http://docs.openstack.org/infra/manual/developers.html
[3] https://git.openstack.org/cgit/openstack/charm-rabbitmq-server
[4] https://github.com/openstack/charm-rabbitmq-server

review: Needs Resubmitting
Revision history for this message
Andrew McLeod (admcleod) wrote :

Hi Ben,

Running the tests manually (bundletester -vFl DEBUG -e AWS --no-destroy) shows that there are initial errors with make lint and make test that look like venv hasn't been set up properly:

http://pastebin.ubuntu.com/17398837/

Then I hit this error:

DEBUG:runner:2016-06-16 17:29:41,453 connect_amqp_by_unit DEBUG: Connecting to amqp on 54.171.15.113:5672 (rabbitmq-server/0) as testuser1...
DEBUG:runner:No handlers could be found for logger "pika.adapters.base_connection"
DEBUG:runner:amqp connection failed to 54.171.15.113:5672 as testuser1 (1)
DEBUG:runner:Exit Code: 1
    014-basic-precise-icehouse ERROR
DEBUG:runner:call ['/tmp/bundletester-zYF3Ob/rabbitmq-server/tests/015-basic-trusty-icehouse'] (cwd: /tmp/bundletester-zYF3Ob/rabbitmq-server)

There are quite a few test failures, really too many to detail in this report, so heres the pastebin:

http://pastebin.ubuntu.com/17426675/

review: Needs Fixing

Unmerged revisions

111. By Benjamin Kaehne

Modifying the stats collections script to use a temporary staging file to write to prior to making stats available in a known file.

This is to eliminate race conditions with scripts which may be reading this file.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/collect_rabbitmq_stats.sh'
2--- scripts/collect_rabbitmq_stats.sh 2015-10-22 13:24:30 +0000
3+++ scripts/collect_rabbitmq_stats.sh 2016-04-05 05:27:09 +0000
4@@ -31,8 +31,10 @@
5 fi
6 DATA_DIR="/var/lib/rabbitmq/data"
7 DATA_FILE="${DATA_DIR}/$(hostname -s)_queue_stats.dat"
8+TMP_DATA_FILE="${DATA_DIR}/.$(hostname -s)_queue_stats.dat.tmp"
9 LOG_DIR="/var/lib/rabbitmq/logs"
10 RABBIT_STATS_DATA_FILE="${DATA_DIR}/$(hostname -s)_general_stats.dat"
11+TMP_RABBIT_STATS_DATA_FILE="${DATA_DIR}/.$(hostname -s)_general_stats.dat.tmp"
12 NOW=$(date +'%s')
13 HOSTNAME=$(hostname -s)
14 MNESIA_DB_SIZE=$(du -sm /var/lib/rabbitmq/mnesia | cut -f1)
15@@ -43,11 +45,13 @@
16 if [ ! -d $LOG_DIR ]; then
17 mkdir -p $LOG_DIR
18 fi
19-echo "#Vhost Name Messages_ready Messages_unacknowledged Messages Consumers Memory Time" > $DATA_FILE
20+echo "#Vhost Name Messages_ready Messages_unacknowledged Messages Consumers Memory Time" > $TMP_DATA_FILE
21 /usr/sbin/rabbitmqctl -q list_vhosts | \
22 while read VHOST; do
23 /usr/sbin/rabbitmqctl -q list_queues -p $VHOST name messages_ready messages_unacknowledged messages consumers memory | \
24- awk "{print \"$VHOST \" \$0 \" $(date +'%s') \"}" >> $DATA_FILE 2>${LOG_DIR}/list_queues.log
25+ awk "{print \"$VHOST \" \$0 \" $(date +'%s') \"}" >> $TMP_DATA_FILE 2>${LOG_DIR}/list_queues.log
26 done
27-echo "mnesia_size: ${MNESIA_DB_SIZE}@$NOW" > $RABBIT_STATS_DATA_FILE
28-echo "rss_size: ${RABBIT_RSS}@$NOW" >> $RABBIT_STATS_DATA_FILE
29+echo "mnesia_size: ${MNESIA_DB_SIZE}@$NOW" > $TMP_RABBIT_STATS_DATA_FILE
30+echo "rss_size: ${RABBIT_RSS}@$NOW" >> $TMP_RABBIT_STATS_DATA_FILE
31+mv $TMP_DATA_FILE $DATA_FILE
32+mv $TMP_RABBIT_STATS_DATA_FILE $RABBIT_STATS_DATA_FILE

Subscribers

People subscribed via source and target branches