~free.ekanayaka/landscape-client/ensure-version

« back to all changes in this revision

Viewing changes to landscape/monitor/mountinfo.py

Merge client-resynchronisation-bug [r=therve,jkakar] [f=144475]

This fixes a long-standing bug in the client which causes resynchronisations on
the server.

The "persistent" data we record about a client's state wasn't being persisted
regularly enough, so there was a window between enqueuing a message with a
state change, and the new state being recorded, if the client was shutdown
during this window, the new state wasn't recorded, but the message remained, so
the state change was notified again after the client was brought back up,
triggering a resynchronisation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
            mount_point = mount_info["mount-point"]
90
90
            self._persist.set(("mount-info", mount_point), mount_info)
91
91
        self._mount_info_to_persist = None
 
92
        # This forces the registry to write the persistent store to disk
 
93
        # This means that the persistent data reflects the state of the
 
94
        # messages sent.
 
95
        self.registry.flush()
92
96
 
93
97
    def run(self):
94
98
        self._monitor.ping()