Use a key-value database such as Berkeley BD for ContainerConfig

Bug #1662655 reported by Christopher Townsend
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libertine
Status tracked in Devel
Devel
Fix Committed
Medium
Larry Price
Trunk
Fix Committed
Medium
Larry Price
libertine (Ubuntu)
Fix Released
Medium
Larry Price

Bug Description

There have been instances of corrupted or disappearing ContainersConfig.json files. We should investigate whether using a key-value database such as Berkeley DB or NoSQL may be a better solution.

Related branches

Changed in libertine:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 1.6
Changed in libertine:
milestone: 1.6 → 1.7
Changed in libertine:
milestone: 1.7 → 1.8
Revision history for this message
Larry Price (larryprice) wrote :

I think I've traced this down to be simpler than expected... We're currently using a file lock on ContainersConfig.json after opening it, so we can get into a situation where we:

1. Open file for writing (clears file)
2. Lock file
3. Open file for reading (so it's an empty file)
4. Wait for file to unlock
5. Write finishes - unlock file
6. Read unblocked, still has an empty file

The solution seems to be to attempt to reopen the file if we don't successfully get the lock.

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

Fix committed into lp:libertine at revision 453, scheduled for release in libertine, milestone Unknown

Changed in libertine:
status: Triaged → Fix Committed
Changed in libertine (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Larry Price (larryprice)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libertine - 1.7.1+17.04.20170331-0ubuntu1

---------------
libertine (1.7.1+17.04.20170331-0ubuntu1) zesty; urgency=medium

  [ Chris Townsend ]
  * When starting pasted, ensure DISPLAY is set and valid before continuing to
    run. (LP: #1666472)
  * Fix pasted to work with rootless Xmir. (LP: #1671257)
  * Add a '-x' option to pkill so it only kills the libertined process(es)
    and nothing else. (LP: #1676005)
  * Remove hard-coded dependency on libraries.

  [ Larry Price ]
  * Bump version to 1.7.1
  * Gracefully handle creating a LibertineContainer object when the container
    backend is unavailable.
  * Update libertine xmir components to not depend on container backends.
    (LP: #1671938)
  * Catch all errors and gracefully shutdown libertined. (LP: #1671009)
  * Fix method call from ContainerControl d-bus to interfaces.
  * Update signal handlers in test_libertine_service to reflect new API.
  * Inject client for accessing ContainerControl within containers.
  * Rearchitect libertine service python backend for simpler access to running
    tasks. (LP: #1669091)
  * Ignore completions from dependencies during snapcraft build.
  * LXD needs to forward host environment to container when running arbitrary
    commands.
  * Add client object to list_app_ids_task to avoid making reentrant service
    calls.
  * Take advantage of new network subcommand during lxd init on newer
    installs.
  * Prevent installing empty package names and appropriately update status for
    unstopped containers.
  * Modifications to make test_libertine_service more stable.
  * Reopen the database file after every failure to grab the lock.
    (LP: #1662655)

 -- Larry Price <email address hidden> Fri, 31 Mar 2017 20:09:39 +0000

Changed in libertine (Ubuntu):
status: In Progress → 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.