Skip to content

Commit

Permalink
Merge pull request #5128 from rcarpa/patch-5110-multihop_tombstone_in…
Browse files Browse the repository at this point in the history
…_cache

Transfers: don't allow timedelta obj in tombstone_from_delay. Fix #5110
  • Loading branch information
bari12 committed Jan 10, 2022
2 parents 20d8fb6 + 00144a4 commit 2204b3d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 1 addition & 5 deletions lib/rucio/core/replica.py
Expand Up @@ -1421,11 +1421,7 @@ def tombstone_from_delay(tombstone_delay):
if not tombstone_delay:
return None

if not isinstance(tombstone_delay, timedelta):
try:
tombstone_delay = timedelta(seconds=int(tombstone_delay))
except ValueError:
return None
tombstone_delay = timedelta(seconds=int(tombstone_delay))

if not tombstone_delay:
return None
Expand Down
14 changes: 9 additions & 5 deletions lib/rucio/core/transfer.py
Expand Up @@ -100,7 +100,7 @@
arguments={'url': config_get('cache', 'url', False, '127.0.0.1:11211'), 'distributed_lock': True})
WEBDAV_TRANSFER_MODE = config_get('conveyor', 'webdav_transfer_mode', False, None)

DEFAULT_MULTIHOP_TOMBSTONE_DELAY = datetime.timedelta(hours=2)
DEFAULT_MULTIHOP_TOMBSTONE_DELAY = int(datetime.timedelta(hours=2).total_seconds())


class RseData:
Expand Down Expand Up @@ -1511,10 +1511,14 @@ def create_missing_replicas_and_requests(
if rws.request_id:
continue

if 'multihop_tombstone_delay' in rws.dest_rse.attributes:
tombstone = tombstone_from_delay(rws.dest_rse.attributes['multihop_tombstone_delay'])
else:
tombstone = tombstone_from_delay(default_tombstone_delay)
tombstone_delay = rws.dest_rse.attributes.get('multihop_tombstone_delay', default_tombstone_delay)
try:
tombstone = tombstone_from_delay(tombstone_delay)
except ValueError:
logger(logging.ERROR, "%s: Cannot parse multihop tombstone delay %s", initial_request_id, tombstone_delay)
creation_successful = False
break

files = [{'scope': rws.scope,
'name': rws.name,
'bytes': rws.byte_count,
Expand Down

0 comments on commit 2204b3d

Please sign in to comment.