Use a key-value database such as Berkeley BD for ContainerConfig
Bug #1662655 reported by
Christopher Townsend
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 ContainersConfi
Related branches
lp://staging/~larryprice/libertine/better-db-locking
- Christopher Townsend (community): Approve
- Libertine CI Bot: Approve (continuous-integration)
-
Diff: 119 lines (+52/-17)1 file modifiedpython/libertine/ContainersConfig.py (+52/-17)
lp://staging/~larryprice/libertine/release-1.7.1
- Christopher Townsend (community): Approve
-
Diff: 4695 lines (+1707/-1017)62 files modifiedCMakeLists.txt (+6/-0)
debian/changelog (+37/-0)
debian/control (+9/-11)
debian/libertine-tools.install (+1/-2)
debian/libertine-xmir-tools.install (+4/-0)
debian/libertined.preinst (+1/-1)
debian/libertined.prerm (+1/-1)
debian/python3-libertine.install (+1/-2)
liblibertine/libertined.cpp (+15/-10)
pasted/pasted.cpp (+97/-43)
pasted/pasted.h (+13/-5)
python/libertine/ChrootContainer.py (+2/-2)
python/libertine/ContainerControlClient.py (+14/-9)
python/libertine/ContainersConfig.py (+52/-17)
python/libertine/Libertine.py (+21/-15)
python/libertine/LxcContainer.py (+7/-9)
python/libertine/LxdContainer.py (+17/-16)
python/libertine/service/constants.py (+27/-0)
python/libertine/service/container.py (+38/-34)
python/libertine/service/container_control.py (+29/-58)
python/libertine/service/container_control_client.py (+75/-0)
python/libertine/service/download.py (+35/-40)
python/libertine/service/operations.py (+18/-62)
python/libertine/service/operations_monitor.py (+93/-0)
python/libertine/service/task_dispatcher.py (+8/-25)
python/libertine/service/tasks/__init__.py (+2/-1)
python/libertine/service/tasks/app_info_task.py (+5/-5)
python/libertine/service/tasks/base_task.py (+39/-14)
python/libertine/service/tasks/container_info_task.py (+4/-4)
python/libertine/service/tasks/create_task.py (+14/-11)
python/libertine/service/tasks/destroy_task.py (+10/-8)
python/libertine/service/tasks/install_task.py (+10/-8)
python/libertine/service/tasks/list_app_ids_task.py (+6/-6)
python/libertine/service/tasks/list_task.py (+4/-3)
python/libertine/service/tasks/remove_task.py (+9/-8)
python/libertine/service/tasks/search_task.py (+4/-4)
python/libertine/service/tasks/update_task.py (+11/-10)
snap/plugins/x-libertine-deps.py (+2/-1)
tests/integration/CMakeLists.txt (+21/-1)
tests/integration/data/libertine/ContainersConfig.json (+19/-0)
tests/integration/test_libertine_service.py (+41/-38)
tests/integration/test_liblibertine.cpp (+145/-0)
tests/unit/CMakeLists.txt (+2/-1)
tests/unit/ContainerConfigListTests.cpp (+1/-0)
tests/unit/service/CMakeLists.txt (+2/-1)
tests/unit/service/tasks/test_app_info_task.py (+24/-26)
tests/unit/service/tasks/test_container_info_task.py (+26/-27)
tests/unit/service/tasks/test_create_task.py (+170/-176)
tests/unit/service/tasks/test_destroy_task.py (+44/-46)
tests/unit/service/tasks/test_install_task.py (+38/-41)
tests/unit/service/tasks/test_list_app_ids_task.py (+23/-25)
tests/unit/service/tasks/test_list_task.py (+15/-16)
tests/unit/service/tasks/test_remove_task.py (+38/-41)
tests/unit/service/tasks/test_search_task.py (+9/-9)
tests/unit/service/tasks/test_update_task.py (+46/-46)
tests/unit/service/test_container.py (+32/-31)
tests/unit/service/test_operations_monitor.py (+146/-0)
tests/unit/service/test_task_dispatcher.py (+6/-5)
tools/libertine-container-manager (+41/-19)
tools/libertine-launch (+12/-2)
tools/libertine-lxd-setup (+37/-14)
tools/libertined (+28/-7)
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 |
Changed in libertine (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Larry Price (larryprice) |
To post a comment you must log in.
I think I've traced this down to be simpler than expected... We're currently using a file lock on ContainersConfi g.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.