From a1c97aa0be0125accbce76906c3ec49a874e8d9e Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 3 Jul 2007 17:38:49 -0700 Subject: [PATCH] storageserver: include metadata in the sizelimit, at least after the bucket has been closed --- src/allmydata/storageserver.py | 6 +++--- src/allmydata/test/test_storage.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/allmydata/storageserver.py b/src/allmydata/storageserver.py index c70d113a..5c5601f0 100644 --- a/src/allmydata/storageserver.py +++ b/src/allmydata/storageserver.py @@ -92,7 +92,7 @@ class BucketWriter(Referenceable): pass self.closed = True - self.ss.bucket_writer_closed(self) + self.ss.bucket_writer_closed(self, fileutil.du(self.finalhome)) def str2l(s): """ split string (pulled from storage) into a list of blockids """ @@ -186,8 +186,8 @@ class StorageServer(service.MultiService, Referenceable): return alreadygot, bucketwriters - def bucket_writer_closed(self, bw): - self.consumed += bw.allocated_size() + def bucket_writer_closed(self, bw, consumed_size): + self.consumed += consumed_size del self._active_writers[bw] def remote_get_buckets(self, storage_index): diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index 4154cbaf..7d02e178 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -16,7 +16,7 @@ class Bucket(unittest.TestCase): fileutil.make_dirs(basedir) return incoming, final - def bucket_writer_closed(self, bw): + def bucket_writer_closed(self, bw, consumed): pass def test_create(self): -- 2.45.2