inc/upgrade:ensure_services_started can't handle processes with spaces

Bug #1484528 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grenade
Fix Released
Undecided
Julien Danjou

Bug Description

ensure_services_started confirms that a process is running, this is used at the end of grenade as a sanity check that we did in fact make the right things go during the upgrade

At the moment that code is not happy with a "service" process that is distinguished by its arguments. A specific case is the ceilometer polling agent. It uses the same script with different namespaces:

   ceilometer-polling --polling-namespaces {compute,central,ipmi}

While in a single node setup it is reasonable to run just one ceilometer-polling, in multi-node it is not. It is also useful, from a log cruising standpoint to run multiple polling agents.

In any case, whatever ceilometer might do, it seems like ensure_services_started ought to be resilient and robust enough to deal with spaces.

I went to fix this myself and the vagrancies of bash quoting took more attention than I had spare at the time and then meant to make a bug but apparently my brain was so used up that I forgot even that.

This issue has now come back up again in relation to this review: https://review.openstack.org/#/c/212498/1 so I was reminded, so (still no spare cycles) I'm writing it down.

Note that in the current ceilometer grenade plugin the workaround has been to run the older, deprecated, differently named version s of the polling agents.

gordon chung (chungg)
Changed in grenade:
status: New → Confirmed
Revision history for this message
Julien Danjou (jdanjou) wrote :

I cannot confirm this by reading the code at least.

Changed in grenade:
assignee: nobody → Julien Danjou (jdanjou)
Revision history for this message
Julien Danjou (jdanjou) wrote :

Ok, actually I read is_service_running which looks correct, but indeed the loop in ensure_services_stopped looks bad.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to grenade (master)

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

Changed in grenade:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to grenade (master)

Reviewed: https://review.openstack.org/219006
Committed: https://git.openstack.org/cgit/openstack-dev/grenade/commit/?id=df6824e9ca136b8784ddd81a2a20b3518cf6e16c
Submitter: Jenkins
Branch: master

commit df6824e9ca136b8784ddd81a2a20b3518cf6e16c
Author: Julien Danjou <email address hidden>
Date: Mon Aug 31 21:51:57 2015 +0200

    Fix whitespace handling in ensure_services_stopped

    If there are whitespaces in the process names (such as a complete args
    list), the current code does not work as it breaks on spaces. This fixes
    it.

    Change-Id: I4a2a982d4153a31971a5f1a1b504b96ce29236f9
    Closes-Bug: #1484528

Changed in grenade:
status: In Progress → Fix Committed
Sean Dague (sdague)
Changed in grenade:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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