[TOPBLOCKER] phased update support does not give idempotent answer for each (machine,update)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu system image |
Fix Released
|
Critical
|
Barry Warsaw |
Bug Description
The phased update implementation in ./systemimage/
def phased_
global _pp_cache
if _pp_cache is None:
with open(UNIQUE_
data = fp.read()
now = str(time.
r = random.Random()
r.seed(data + now)
_pp_cache = r.randint(0, 100)
try:
return _pp_cache
finally:
if reset:
Since the current time is used as a seed, this function will return a different value each time it's called.
The phased update model requires that, for each given machine and each given update, the calculated percentage persists. With this implementation, since the seed is different for each invocation and the result is not cached, phasing will happen much more quickly than intended.
system-image should avoid using the time as a seed, and instead use a predictable (but well-distributed) seed of the machine ID plus an image identifier (perhaps full channel name + image ID).
Related branches
- Steve Langasek: Pending requested
- Michael Vogt: Pending requested
- Registry Administrators: Pending requested
-
Diff: 2144 lines (+861/-400)24 files modified.bzrignore (+1/-1)
NEWS.rst (+14/-0)
cli-manpage.rst (+7/-2)
systemimage/config.py (+15/-0)
systemimage/helpers.py (+11/-18)
systemimage/index.py (+1/-4)
systemimage/main.py (+12/-1)
systemimage/scores.py (+29/-13)
systemimage/state.py (+4/-1)
systemimage/testing/controller.py (+7/-5)
systemimage/testing/helpers.py (+10/-0)
systemimage/testing/service.py (+8/-0)
systemimage/tests/data/index_22.json (+2/-3)
systemimage/tests/data/index_26.json (+245/-0)
systemimage/tests/test_candidates.py (+16/-24)
systemimage/tests/test_config.py (+23/-0)
systemimage/tests/test_helpers.py (+51/-43)
systemimage/tests/test_index.py (+0/-42)
systemimage/tests/test_main.py (+180/-195)
systemimage/tests/test_scores.py (+83/-10)
systemimage/tests/test_state.py (+130/-36)
systemimage/tests/test_winner.py (+1/-1)
systemimage/version.txt (+1/-1)
tools/runme.sh (+10/-0)
- Ubuntu CI managed package branches: Pending requested
-
Diff: 2373 lines (+960/-412)34 files modifiedMANIFEST.in (+1/-1)
NEWS.rst (+15/-1)
PKG-INFO (+1/-1)
cli-manpage.rst (+7/-2)
coverage.ini (+2/-0)
dbus-manpage.rst (+2/-2)
debian/README.Debian (+13/-0)
debian/changelog (+20/-0)
ini-manpage.rst (+2/-2)
system_image.egg-info/PKG-INFO (+1/-1)
system_image.egg-info/SOURCES.txt (+3/-1)
systemimage/config.py (+15/-0)
systemimage/download.py (+12/-4)
systemimage/helpers.py (+11/-18)
systemimage/index.py (+1/-4)
systemimage/main.py (+12/-1)
systemimage/scores.py (+29/-13)
systemimage/state.py (+4/-1)
systemimage/testing/controller.py (+7/-5)
systemimage/testing/helpers.py (+10/-0)
systemimage/testing/service.py (+8/-0)
systemimage/tests/data/index_22.json (+2/-3)
systemimage/tests/data/index_26.json (+245/-0)
systemimage/tests/test_candidates.py (+16/-24)
systemimage/tests/test_config.py (+35/-0)
systemimage/tests/test_helpers.py (+51/-43)
systemimage/tests/test_index.py (+0/-42)
systemimage/tests/test_main.py (+209/-195)
systemimage/tests/test_scores.py (+83/-10)
systemimage/tests/test_state.py (+130/-36)
systemimage/tests/test_winner.py (+1/-1)
systemimage/version.txt (+1/-1)
tools/runme.sh (+10/-0)
tox.ini (+1/-0)
Changed in system-image (Ubuntu): | |
assignee: | nobody → Barry Warsaw (barry) |
no longer affects: | system-image (Ubuntu) |
Changed in ubuntu-system-image: | |
assignee: | nobody → Barry Warsaw (barry) |
importance: | Undecided → High |
milestone: | none → 2.5.1 |
status: | New → Triaged |
Changed in ubuntu-system-image: | |
status: | Triaged → In Progress |
tags: | added: client |
Changed in ubuntu-system-image: | |
importance: | High → Critical |
Changed in ubuntu-system-image: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-system-image: | |
status: | Fix Committed → Fix Released |
summary: |
- phased update support does not give idempotent answer for each - (machine,update) + [TOPBLOCKER] phased update support does not give idempotent answer for + each (machine,update) |
This bug is important to fix before phone images go to factory, since it impacts our ability to do phased over-the-air updates.