in some scenarios with mongo not running stop_hook will fail and preclude progress

Bug #1370541 reported by Samuele Pedroni
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MongoDB Charm
Won't Fix
Low
Unassigned

Bug Description

when attaching a volume for example

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

I provisioned units, knowing that they would not be useful until I could get the volumes up and in the volume-map setting. Unfortunately once I did get these new units sorted out for persistent volumes, mongodb was down and all hooks complained about the absence of /var/lib/mongodb/mongod.lock

In the end I had to work around this by manually starting up badly-configured mongodb services on all units and doing a resolved --retry. Ultimately it shouldn't care if mongodb was down already, at this point.

affects: mongodb (Juju Charms Collection) → mongodb-charm
Revision history for this message
Xav Paice (xavpaice) wrote :

  @hooks.hook('stop')
  def stop_hook():
      juju_log("stop_hook")
      try:
          retVal = service('stop', 'mongodb')
          os.remove('/var/lib/mongodb/mongod.lock')
          # FIXME Need to check if this is still needed
      except Exception, e:
          juju_log(str(e))
          retVal = False
      finally:
          juju_log("stop_hook returns: %s" % retVal)
          return(retVal)

In the stop hook, although removal of the mongod.lock is caught in a try/except, if the remove fails for any reason (including it not being there to remove), the hook itself will return a fail.

Changed in charm-mongodb:
importance: Undecided → Low
status: New → Triaged
Eric Chen (eric-chen)
Changed in charm-mongodb:
status: Triaged → Won't Fix
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.