configstore: if the size of the serialised jenv decreases the .jenv file will be corrupt

Bug #1348458 reported by Dave Cheney
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Dave Cheney

Bug Description

Due to dint of fate, or sheer dumb luck, the on disk size of .jenv files always grew -- never shrank.

However, if they do, the new, smaller, contents of the file are written starting from offset 0, _but_not_truncating_ and this causes the previous contents of the file to be visible at the bottom of the file.

The end result is if the size of the environinfo shrinks, possibly because the set of API addresses shrinks, then the jenv file will be corrupted -- readers of the file will see the bit of the yaml which was not overwritten at the end of the file

Revision history for this message
Dave Cheney (dave-cheney) wrote :
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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