self = <Retrying object at 0x7f0011bc8eb8 (stop=<tenacity.stop.stop_after_attempt object at 0x7f0245561278>, wait=<tenacity.w...0x7f02455b9510>, before=<function before_nothing at 0x7f02464ebb70>, after=<function after_nothing at 0x7f0246502048>)>
fn = <function retry_function.<locals>.newf at 0x7f0022715b70>
args = ([b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89'],)
kwargs = {}
retry_state = <RetryCallState 139638274279520: attempt #3; slept for 0.74; last result: failed (AttributeError 'InMemoryCqlRunner' object has no attribute 'content_get_from_tokens')>
do = <tenacity.DoAttempt object at 0x7f0036c88588>
def __call__(self, fn: t.Callable[..., _RetValT], *args: t.Any, **kwargs: t.Any) -> _RetValT:
self.begin()
retry_state = RetryCallState(retry_object=self, fn=fn, args=args, kwargs=kwargs)
while True:
do = self.iter(retry_state=retry_state)
if isinstance(do, DoAttempt):
try:
> result = fn(*args, **kwargs)
.tox/py3/lib/python3.7/site-packages/tenacity/__init__.py:407:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = ([b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89'],)
kwargs = {}
@swh_retry
def newf(*args, **kwargs):
> return getattr(storage, attribute_name)(*args, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/storage/proxies/retry.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = (<swh.storage.in_memory.InMemoryStorage object at 0x7f003b777cf8>, [b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89'])
kw = {}
@wraps(f)
def d(*a, **kw):
with statsd.timed(DURATION_METRIC, tags={"endpoint": f.__name__}):
> return f(*a, **kw)
.tox/py3/lib/python3.7/site-packages/swh/storage/metrics.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f003b777cf8>
contents = [b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89']
algo = 'sha1'
@timed
def content_get(
self, contents: List[bytes], algo: str = "sha1"
) -> List[Optional[Content]]:
if algo not in DEFAULT_ALGORITHMS:
raise StorageArgumentException(
"algo should be one of {','.join(DEFAULT_ALGORITHMS)}"
)
key = operator.attrgetter(algo)
contents_by_hash: Dict[Sha1, Optional[Content]] = {}
> for row in self._content_get_from_hashes(algo, contents):
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f003b777cf8>
algo = 'sha1'
hashes = [b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89']
def _content_get_from_hashes(self, algo, hashes: List[bytes]) -> Iterable:
"""From the name of a hash algorithm and a value of that hash,
looks up the "hash -> token" secondary table (content_by_{algo})
to get tokens.
Then, looks up the main table (content) to get all contents with
that token, and filters out contents whose hash doesn't match."""
found_tokens = list(
self._cql_runner.content_get_tokens_from_single_algo(algo, hashes)
)
assert all(isinstance(token, int) for token in found_tokens)
# Query the main table ('content').
> rows = self._cql_runner.content_get_from_tokens(found_tokens)
E AttributeError: 'InMemoryCqlRunner' object has no attribute 'content_get_from_tokens'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:172: AttributeError
The above exception was the direct cause of the following exception:
swh_storage = <swh.storage.proxies.retry.RetryingProxyStorage object at 0x7f003b777fd0>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f0011bc4e10>
def test_retrying_proxy_storage_content_add_metadata(swh_storage, sample_data):
"""Standard content_add_metadata works as before
"""
sample_content = sample_data.content
content = attr.evolve(sample_content, data=None)
pk = content.sha1
> content_metadata = swh_storage.content_get([pk])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_retry.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/tenacity/__init__.py:324: in wrapped_f
return self(f, *args, **kw)
.tox/py3/lib/python3.7/site-packages/tenacity/__init__.py:404: in __call__
do = self.iter(retry_state=retry_state)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Retrying object at 0x7f0011bc8eb8 (stop=<tenacity.stop.stop_after_attempt object at 0x7f0245561278>, wait=<tenacity.w...0x7f02455b9510>, before=<function before_nothing at 0x7f02464ebb70>, after=<function after_nothing at 0x7f0246502048>)>
retry_state = <RetryCallState 139638274279520: attempt #3; slept for 0.74; last result: failed (AttributeError 'InMemoryCqlRunner' object has no attribute 'content_get_from_tokens')>
def iter(self, retry_state: "RetryCallState") -> t.Union[DoAttempt, DoSleep, t.Any]: # noqa
fut = retry_state.outcome
if fut is None:
if self.before is not None:
self.before(retry_state)
return DoAttempt()
is_explicit_retry = retry_state.outcome.failed and isinstance(retry_state.outcome.exception(), TryAgain)
if not (is_explicit_retry or self.retry(retry_state=retry_state)):
return fut.result()
if self.after is not None:
self.after(retry_state)
self.statistics["delay_since_first_attempt"] = retry_state.seconds_since_start
if self.stop(retry_state=retry_state):
if self.retry_error_callback:
return self.retry_error_callback(retry_state)
retry_exc = self.retry_error_cls(fut)
if self.reraise:
raise retry_exc.reraise()
> raise retry_exc from fut.exception()
E tenacity.RetryError: RetryError[<Future at 0x7f0036c88be0 state=finished raised AttributeError>]
.tox/py3/lib/python3.7/site-packages/tenacity/__init__.py:361: RetryError
TEST RESULT
TEST RESULT
- Run At
- Sep 15 2021, 3:20 PM