[Python-Dev] Python-Dev] wait time [was: Ext4 data loss
Steven D'Aprano
steve at pearwood.info
Fri Mar 13 04:27:35 CET 2009
On Fri, 13 Mar 2009 01:02:26 pm R. David Murray wrote:
> On Fri, 13 Mar 2009 at 00:35, Antoine Pitrou wrote:
> > R. David Murray <rdmurray <at> bitdance.com> writes:
> >> Seriously, though, the point is that IMO an application should not
> >> be calling fsync unless it provides a way for that behavior to be
> >> controlled by the user.
> >
> > But whether an application does it or not is none of Python's
> > business, is it? What is the disagreement exactly?
>
> I'd like to see whatever feature gets added support the application
> writer in making this user controllable, or at the very least
> document that this to do so is best practice if you use the sync
> feature.
It's not best practice. It may be best practice for a certain class of
users and applications, e.g. those who value the ability to control
low-level behaviour of the app, but it is poor practice for other
classes of users and applications. Do you really think that having
Minefield make the file syncing behaviour of the high scores file
user-configurable is best practice? People care about their high
scores, but they don't care that much.
It may even lead to more data loss than leaving it out:
* If the application chooses a specific strategy, this strategy might
(for the sake of the argument) lead to data loss once in ten million
writes on average.
* If the application makes this a configuration option, the increased
complexity of writing the code, and the increased number of paths that
need to be tested, may lead to bugs which cause data loss. This may be
more risky than the original strategy above (whatever that happens to
be.)
Complexity is not cost-free, and insisting that the more complex,
expensive solution is always "best practice" is wrong.
--
Steven D'Aprano
More information about the Python-Dev
mailing list