[Python-Dev] Python-Dev] wait time [was: Ext4 data loss

Lie Ryan lie.1296 at gmail.com
Fri Mar 13 08:31:59 CET 2009


Steven D'Aprano wrote:
> 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.

If the pops and moms uses a financial program and lost their only copy 
of 10 years worth of financial data, they'll simply be confused and 
that's it.

Meanwhile if a network administrator needs to squeeze the last bit of 
performance out of his backup script, he definitely would threaten the 
dev-team of the programming language to make manual sync file writing 
the default, since it makes it difficult for him to fine-tune the 
syncing process.



More information about the Python-Dev mailing list