[ARVADOS] updated: 2.1.0-797-g205aecd08

Git user git at public.arvados.org
Mon Jun 7 14:08:16 UTC 2021


Summary of changes:
 sdk/python/arvados/collection.py     |  1 -
 sdk/python/arvados/keep.py           | 10 +++++++---
 sdk/python/tests/test_keep_client.py |  7 ++++---
 3 files changed, 11 insertions(+), 7 deletions(-)

       via  205aecd0875343feaec88e7f0e78dd6e9db1fd9c (commit)
       via  b4808aa380097befefde114a0a87f41270c862bb (commit)
      from  5ab34436e2c47cebedd81fe6d38bdcbc40d6c373 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 205aecd0875343feaec88e7f0e78dd6e9db1fd9c
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon Jun 7 11:02:22 2021 -0300

    17465: Fixed tests and made the suite less noisy.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 1d4092d55..86b1d91b8 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -570,8 +570,8 @@ class KeepClient(object):
             self.confirmed_storage_classes = {}
             self.response = None
             self.storage_classes_tracking = True
-            self.queue_data_lock = threading.Lock()
-            self.pending_tries = max(copies, len(classes))+1
+            self.queue_data_lock = threading.RLock()
+            self.pending_tries = max(copies, len(classes))
             self.pending_tries_notification = threading.Condition()
 
         def write_success(self, response, replicas_nr, classes_confirmed):
@@ -585,6 +585,7 @@ class KeepClient(object):
                             self.confirmed_storage_classes[st_class] += st_copies
                         except KeyError:
                             self.confirmed_storage_classes[st_class] = st_copies
+                    self.pending_tries = max(self.wanted_copies - self.successful_copies, len(self.pending_classes()))
                 self.response = response
             with self.pending_tries_notification:
                 self.pending_tries_notification.notify_all()
diff --git a/sdk/python/tests/test_keep_client.py b/sdk/python/tests/test_keep_client.py
index cdc492b51..0eefa586d 100644
--- a/sdk/python/tests/test_keep_client.py
+++ b/sdk/python/tests/test_keep_client.py
@@ -607,14 +607,15 @@ class KeepStorageClassesTestCase(unittest.TestCase, tutil.ApiClientMock):
             # wanted_copies, wanted_classes, confirmed_copies, confirmed_classes, return_code
             [ 1, ['foo'], 1, 'bar=1', 200],
             [ 1, ['foo'], 1, None, 503],
-            [ 2, ['foo'], 1, 'bar=1, foo=1', 200],
-            [ 2, ['foo, bar'], 1, 'bar=2, foo=1', 200],
+            [ 2, ['foo'], 1, 'bar=1, foo=0', 200],
+            [ 3, ['foo'], 1, 'bar=1, foo=1', 200],
+            [ 3, ['foo', 'bar'], 1, 'bar=2, foo=1', 200],
         ]
         for w_copies, w_classes, c_copies, c_classes, return_code in cases:
             headers = {'x-keep-replicas-stored': c_copies}
             if c_classes is not None:
                 headers.update({'x-keep-storage-classes-confirmed': c_classes})
-            with tutil.mock_keep_responses(self.locator, return_code, **headers):
+            with tutil.mock_keep_responses(self.locator, return_code, return_code, **headers):
                 case_desc = 'wanted_copies={}, wanted_classes="{}", confirmed_copies={}, confirmed_classes="{}"'.format(w_copies, ', '.join(w_classes), c_copies, c_classes)
                 with self.assertRaises(arvados.errors.KeepWriteError, msg=case_desc):
                     self.keep_client.put(self.data, copies=w_copies, classes=w_classes)

commit b4808aa380097befefde114a0a87f41270c862bb
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Jun 3 19:34:26 2021 -0300

    17465: Don't repeat warnings when storage classes aren't supported.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index c000c8071..44d032535 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -1424,7 +1424,6 @@ class Collection(RichCollectionBase):
             copies = (self.replication_desired or
                       self._my_api()._rootDesc.get('defaultCollectionReplication',
                                                    2))
-            classes = self.storage_classes_desired or []
             self._block_manager = _BlockManager(self._my_keep(), copies=copies, put_threads=self.put_threads, num_retries=self.num_retries, storage_classes_func=self.storage_classes_desired)
         return self._block_manager
 
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 2f20132ae..1d4092d55 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -840,6 +840,7 @@ class KeepClient(object):
         self.get_counter = Counter()
         self.hits_counter = Counter()
         self.misses_counter = Counter()
+        self._storage_classes_unsupported_warning = False
 
         if local_store:
             self.local_store = local_store
@@ -1253,7 +1254,9 @@ class KeepClient(object):
                 # success is determined only by successful copies.
                 #
                 # Disable storage classes tracking from this point forward.
-                _logger.warning("X-Keep-Storage-Classes header not supported by the cluster")
+                if not self._storage_classes_unsupported_warning:
+                    self._storage_classes_unsupported_warning = True
+                    _logger.warning("X-Keep-Storage-Classes header not supported by the cluster")
                 done_classes = None
                 loop.save_result(
                     (done_copies >= copies, writer_pool.total_task_nr))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list