From: Zooko O'Whielacronx Date: Tue, 8 Jan 2008 18:15:06 +0000 (-0700) Subject: direct the user to docs/write_coordination.html in case of an UncoordinatedWriteError X-Git-Tag: allmydata-tahoe-0.7.0~11 X-Git-Url: https://git.rkrishnan.org/specifications//%22%3C?a=commitdiff_plain;h=9e2ed2df01cf427c1c1a63ba3f09bccfe175277d;p=tahoe-lafs%2Ftahoe-lafs.git direct the user to docs/write_coordination.html in case of an UncoordinatedWriteError --- diff --git a/docs/write_coordination.html b/docs/write_coordination.html new file mode 100644 index 00000000..8844ecde --- /dev/null +++ b/docs/write_coordination.html @@ -0,0 +1,16 @@ + + + + Avoiding Write Collisions in Tahoe + + + + + + + +

Write Collisions

+

Tahoe does not provide locking of the mutable files and directories. If there is more than one simultaneous attempt to change a mutable file or directory, then an UncoordinatedWriteError

will result. This might, in rare cases, cause the file or directory contents to be accidentally deleted. The user is expected to ensure that there is at most one outstanding write or update request for a given file or directory at a time. One convenient way to accomplish this is to make a different file or directory for each person or process which wants to write.

+ + + diff --git a/src/allmydata/mutable.py b/src/allmydata/mutable.py index 37d45980..c70061d8 100644 --- a/src/allmydata/mutable.py +++ b/src/allmydata/mutable.py @@ -27,7 +27,8 @@ class NeedMoreDataError(Exception): return "" % self.needed_bytes class UncoordinatedWriteError(Exception): - pass + def __repr__(self): + return "<%s -- You, oh user, tried to change a file or directory at the same time as another process was trying to change it. To avoid data loss, don't do this. Please see docs/write_coordination.html for details.>" % (self.__class__.__name__,) class CorruptShareError(Exception): def __init__(self, peerid, shnum, reason):