From 6374f4307f6e48b44de2bd88087ccf03db94d2b4 Mon Sep 17 00:00:00 2001
From: Kevan Carstensen <kevan@isnotajoke.com>
Date: Thu, 15 Jul 2010 16:21:05 -0700
Subject: [PATCH] storage/immutable.py: make remote_abort btell the storage
 server about aborted buckets.

---
 src/allmydata/storage/immutable.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/allmydata/storage/immutable.py b/src/allmydata/storage/immutable.py
index 0b43b598..b7c4a9f9 100644
--- a/src/allmydata/storage/immutable.py
+++ b/src/allmydata/storage/immutable.py
@@ -279,13 +279,20 @@ class BucketWriter(Referenceable):
     def _abort(self):
         if self.closed:
             return
+
         os.remove(self.incominghome)
         # if we were the last share to be moved, remove the incoming/
         # directory that was our parent
         parentdir = os.path.split(self.incominghome)[0]
         if not os.listdir(parentdir):
             os.rmdir(parentdir)
+        self._sharefile = None
 
+        # We are now considered closed for further writing. We must tell
+        # the storage server about this so that it stops expecting us to
+        # use the space it allocated for us earlier.
+        self.closed = True
+        self.ss.bucket_writer_closed(self, 0)
 
 
 class BucketReader(Referenceable):
-- 
2.45.2