Access information from traces are not propagated to datasets
Motivation
----------

It has come to our attention that, while files have proper access times, datasets do not.

https://github.com/rucio/rucio/blob/58a5ff3bff3bdff2b7251167522dbfe4c0b444f8/lib/rucio/daemons/tracer/kronos.py#L410-L416

Effectively, `__update_datasets()` is not run during the daemon loop; it’s only run when the daemon exits. Most likely, there isn’t enough time to process all the datasets. This is a regression from #5687.

Modification
------------

Replace this obsolete and non-functional wait mechanism with the `run_daemon()`’s `sleep_time`.
diff --git a/lib/rucio/daemons/tracer/kronos.py b/lib/rucio/daemons/tracer/kronos.py
index c80e72bf1..4dc67ad6d 100644
--- a/lib/rucio/daemons/tracer/kronos.py
+++ b/lib/rucio/daemons/tracer/kronos.py
@@ -389,7 +389,8 @@ def run_once_kronos_file(heartbeat_handler: HeartbeatHandler, return_values: Dic
             conn.subscribe(destination=config_get('tracer-kronos', 'queue'), ack='client-individual', id=subscription_id, headers={'activemq.prefetchSize': prefetch_size})
 
 
-def kronos_dataset(once: bool = False, dataset_queue: Queue = None, sleep_time: int = 60):
+def kronos_dataset(dataset_queue: Queue, once: bool = False, sleep_time: int = 60):
+    return_values = {'heartbeat_handler': HeartbeatHandler("kronos-dataset", 10)}
     run_daemon(
         once=once,
         graceful_stop=graceful_stop,
@@ -400,23 +401,21 @@ def kronos_dataset(once: bool = False, dataset_queue: Queue = None, sleep_time:
         run_once_fnc=functools.partial(
             run_once_kronos_dataset,
             dataset_queue=dataset_queue,
+            return_values=return_values,
         )
     )
 
-    # once again for the backlog
-    __update_datasets(dataset_queue)
-
+    # once again for potential backlog
+    run_once_kronos_dataset(dataset_queue=dataset_queue, return_values=return_values, heartbeat_handler=return_values['heartbeat_handler'], sleep_time=sleep_time)
 
-def run_once_kronos_dataset(heartbeat_handler: HeartbeatHandler, dataset_queue: Queue, **kwargs):
-    _, _, logger = heartbeat_handler.live()
-    dataset_wait = config_get_int('tracer-kronos', 'dataset_wait')
-    start = datetime.now()
-    if (datetime.now() - start).seconds > dataset_wait:
-        __update_datasets(dataset_queue=dataset_queue, logger=logger)
-        start = datetime.now()
 
+def run_once_kronos_dataset(dataset_queue: Queue, return_values: dict, heartbeat_handler: HeartbeatHandler, **kwargs):
+    if heartbeat_handler is None:
+        if "heartbeat_handler" not in return_values.keys():
+            return_values["heartbeat_handler"] = HeartbeatHandler("kronos-dataset", 10)
+        heartbeat_handler = return_values["heartbeat_handler"]
 
-def __update_datasets(dataset_queue, logger=logging.log):
+    _, _, logger = heartbeat_handler.live()
     len_ds = dataset_queue.qsize()
     datasets = {}
     dslocks = {}
['lib/rucio/daemons/tracer/kronos.py']