Skip to content

Don't reset scheduled save timer on every write

Brian Tarricone requested to merge kelnos/xfconf:fix-possible-never-flush into master

While perhaps unlikely, if even one xfconf client modifies a setting at an interval of less than 5 seconds (or there are just enough random setting modifications from random apps), then changes to various channels could never get written to disk until xfconfd shuts down. If xfconfd never shuts down in an orderly manner (crash, power failure, whatever), then every settings write could be lost.

Even if the situation is much more mild, and some sort of settings modification "storm" only happens every now and then, we could see the actual flush to disk being delayed by several minutes, which increases the window of time for possible data loss if there's a crash or power failure.

Instead, we should just flush to disk at most 5 seconds after a write. If more writes come in during that 5-second delay, they shouldn't reset the timer; they should just get flushed out after whatever remaining seconds have elapsed.

Merge request reports