collect_rabbitmq_stats.sh should write to a temp file prior to making stats available

Bug #1569143 reported by Benjamin Kaehne
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack RabbitMQ Server Charm
Fix Released
Medium
Liam Young
rabbitmq-server (Juju Charms Collection)
Invalid
Undecided
Unassigned

Bug Description

collect_rabbitmq_stats.sh should write to a temp file prior to making stats available.

While reading information from rabbit, the script should stage all writes to a temp file then make stats avail to any scripts which may read off this file.

The current issue is that any script which reads the stats file while it is being generated could potentially read an empty or half written file resulting in false errors to the consumer of the file.

James Page (james-page)
Changed in rabbitmq-server (Juju Charms Collection):
status: New → Invalid
Liam Young (gnuoy)
Changed in charm-rabbitmq-server:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Liam Young (gnuoy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-rabbitmq-server (master)

Fix proposed to branch: master
Review: https://review.openstack.org/508849

Changed in charm-rabbitmq-server:
status: Confirmed → In Progress
Liam Young (gnuoy)
Changed in charm-rabbitmq-server:
milestone: none → 17.11
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-rabbitmq-server (master)

Reviewed: https://review.openstack.org/508849
Committed: https://git.openstack.org/cgit/openstack/charm-rabbitmq-server/commit/?id=a8f7dea190a6e698d7851642fd16b67c5ed4f6fa
Submitter: Jenkins
Branch: master

commit a8f7dea190a6e698d7851642fd16b67c5ed4f6fa
Author: Liam Young <email address hidden>
Date: Mon Oct 2 11:00:14 2017 +0000

    Write stats to tmp file before updating data file

    This change updates the stats collection script so it writes to a
    temporary file before updating the main stats file to ensure that
    the update is an atomic operation.

    Change-Id: I68d4e3e723ed62fb5e90ba6bcf284c432ba9cd6b
    Closes-Bug: #1569143

Changed in charm-rabbitmq-server:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-rabbitmq-server:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.