direct the user to docs/write_coordination.html in case of an UncoordinatedWriteError

This commit is contained in:
Zooko O'Whielacronx 2008-01-08 11:15:06 -07:00
parent 5ea9f156be
commit 9e2ed2df01
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,16 @@
<!DOCtype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Avoiding Write Collisions in Tahoe</title>
<link rev="made" class="mailto" href="mailto:zooko[at]zooko[dot]com">
<meta name="description" content="how to avoid write collisions in Tahoe">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="tahoe secure decentralized filesystem installation">
</head>
<body>
<h1>Write Collisions</h1>
<p>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 <cite>UncoordinatedWriteError</p> 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.</p>
</body>
</html>

View File

@ -27,7 +27,8 @@ class NeedMoreDataError(Exception):
return "<NeedMoreDataError (%d bytes)>" % 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):