rucio 35.7.0__py3-none-any.whl → 37.0.0rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rucio might be problematic. Click here for more details.
- rucio/alembicrevision.py +1 -1
- rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
- rucio/cli/account.py +216 -0
- rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
- rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
- rucio/cli/command.py +272 -0
- rucio/cli/config.py +72 -0
- rucio/cli/did.py +191 -0
- rucio/cli/download.py +128 -0
- rucio/cli/lifetime_exception.py +33 -0
- rucio/cli/replica.py +162 -0
- rucio/cli/rse.py +293 -0
- rucio/cli/rule.py +158 -0
- rucio/cli/scope.py +40 -0
- rucio/cli/subscription.py +73 -0
- rucio/cli/upload.py +60 -0
- rucio/cli/utils.py +226 -0
- rucio/client/accountclient.py +0 -1
- rucio/client/baseclient.py +33 -24
- rucio/client/client.py +45 -1
- rucio/client/didclient.py +5 -3
- rucio/client/downloadclient.py +6 -8
- rucio/client/replicaclient.py +0 -2
- rucio/client/richclient.py +317 -0
- rucio/client/rseclient.py +4 -4
- rucio/client/uploadclient.py +26 -12
- rucio/common/bittorrent.py +234 -0
- rucio/common/cache.py +66 -29
- rucio/common/checksum.py +168 -0
- rucio/common/client.py +122 -0
- rucio/common/config.py +22 -35
- rucio/common/constants.py +61 -3
- rucio/common/didtype.py +72 -24
- rucio/common/dumper/__init__.py +45 -38
- rucio/common/dumper/consistency.py +75 -30
- rucio/common/dumper/data_models.py +63 -19
- rucio/common/dumper/path_parsing.py +19 -8
- rucio/common/exception.py +65 -8
- rucio/common/extra.py +5 -10
- rucio/common/logging.py +13 -13
- rucio/common/pcache.py +8 -7
- rucio/common/plugins.py +59 -27
- rucio/common/policy.py +12 -3
- rucio/common/schema/__init__.py +84 -34
- rucio/common/schema/generic.py +0 -17
- rucio/common/schema/generic_multi_vo.py +0 -17
- rucio/common/stomp_utils.py +383 -119
- rucio/common/test_rucio_server.py +12 -6
- rucio/common/types.py +132 -52
- rucio/common/utils.py +93 -643
- rucio/core/account_limit.py +14 -12
- rucio/core/authentication.py +2 -2
- rucio/core/config.py +23 -42
- rucio/core/credential.py +14 -15
- rucio/core/did.py +5 -1
- rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
- rucio/core/did_meta_plugins/filter_engine.py +62 -3
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +43 -30
- rucio/core/did_meta_plugins/postgres_meta.py +75 -39
- rucio/core/identity.py +6 -5
- rucio/core/importer.py +4 -3
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +8 -7
- rucio/core/message.py +6 -0
- rucio/core/monitor.py +30 -29
- rucio/core/naming_convention.py +2 -2
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +11 -9
- rucio/core/permission/__init__.py +79 -37
- rucio/core/permission/generic.py +1 -7
- rucio/core/permission/generic_multi_vo.py +1 -7
- rucio/core/quarantined_replica.py +4 -3
- rucio/core/replica.py +464 -139
- rucio/core/replica_sorter.py +55 -59
- rucio/core/request.py +34 -32
- rucio/core/rse.py +301 -97
- rucio/core/rse_counter.py +1 -2
- rucio/core/rse_expression_parser.py +7 -7
- rucio/core/rse_selector.py +9 -7
- rucio/core/rule.py +41 -40
- rucio/core/rule_grouping.py +42 -40
- rucio/core/scope.py +5 -4
- rucio/core/subscription.py +26 -28
- rucio/core/topology.py +11 -11
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +29 -15
- rucio/core/volatile_replica.py +4 -3
- rucio/daemons/atropos/atropos.py +1 -1
- rucio/daemons/auditor/__init__.py +2 -2
- rucio/daemons/auditor/srmdumps.py +6 -6
- rucio/daemons/automatix/automatix.py +32 -21
- rucio/daemons/badreplicas/necromancer.py +2 -2
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +26 -90
- rucio/daemons/common.py +15 -25
- rucio/daemons/conveyor/finisher.py +2 -2
- rucio/daemons/conveyor/poller.py +18 -28
- rucio/daemons/conveyor/receiver.py +53 -123
- rucio/daemons/conveyor/stager.py +1 -0
- rucio/daemons/conveyor/submitter.py +3 -3
- rucio/daemons/hermes/hermes.py +129 -369
- rucio/daemons/judge/evaluator.py +2 -2
- rucio/daemons/oauthmanager/oauthmanager.py +3 -3
- rucio/daemons/reaper/dark_reaper.py +7 -3
- rucio/daemons/reaper/reaper.py +12 -16
- rucio/daemons/rsedecommissioner/config.py +1 -1
- rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
- rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
- rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
- rucio/daemons/storage/consistency/actions.py +8 -6
- rucio/daemons/tracer/kronos.py +117 -142
- rucio/db/sqla/constants.py +5 -0
- rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
- rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
- rucio/db/sqla/models.py +157 -154
- rucio/db/sqla/session.py +58 -27
- rucio/db/sqla/types.py +2 -2
- rucio/db/sqla/util.py +2 -2
- rucio/gateway/account.py +18 -12
- rucio/gateway/account_limit.py +137 -60
- rucio/gateway/authentication.py +18 -12
- rucio/gateway/config.py +30 -20
- rucio/gateway/credential.py +9 -10
- rucio/gateway/did.py +70 -53
- rucio/gateway/dirac.py +6 -4
- rucio/gateway/exporter.py +3 -2
- rucio/gateway/heartbeat.py +6 -4
- rucio/gateway/identity.py +36 -51
- rucio/gateway/importer.py +3 -2
- rucio/gateway/lifetime_exception.py +3 -2
- rucio/gateway/meta_conventions.py +17 -6
- rucio/gateway/permission.py +4 -1
- rucio/gateway/quarantined_replica.py +3 -2
- rucio/gateway/replica.py +31 -22
- rucio/gateway/request.py +27 -18
- rucio/gateway/rse.py +69 -37
- rucio/gateway/rule.py +46 -26
- rucio/gateway/scope.py +3 -2
- rucio/gateway/subscription.py +14 -11
- rucio/gateway/vo.py +12 -8
- rucio/rse/__init__.py +3 -3
- rucio/rse/protocols/bittorrent.py +11 -1
- rucio/rse/protocols/cache.py +0 -11
- rucio/rse/protocols/dummy.py +0 -11
- rucio/rse/protocols/gfal.py +14 -9
- rucio/rse/protocols/globus.py +1 -1
- rucio/rse/protocols/http_cache.py +1 -1
- rucio/rse/protocols/posix.py +2 -2
- rucio/rse/protocols/protocol.py +84 -317
- rucio/rse/protocols/rclone.py +2 -1
- rucio/rse/protocols/rfio.py +10 -1
- rucio/rse/protocols/ssh.py +2 -1
- rucio/rse/protocols/storm.py +2 -13
- rucio/rse/protocols/webdav.py +74 -30
- rucio/rse/protocols/xrootd.py +2 -1
- rucio/rse/rsemanager.py +170 -53
- rucio/rse/translation.py +260 -0
- rucio/tests/common.py +23 -13
- rucio/tests/common_server.py +26 -9
- rucio/transfertool/bittorrent.py +15 -14
- rucio/transfertool/bittorrent_driver.py +5 -7
- rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
- rucio/transfertool/fts3.py +20 -16
- rucio/transfertool/mock.py +2 -3
- rucio/vcsversion.py +4 -4
- rucio/version.py +7 -0
- rucio/web/rest/flaskapi/v1/accounts.py +17 -3
- rucio/web/rest/flaskapi/v1/auth.py +5 -5
- rucio/web/rest/flaskapi/v1/credentials.py +3 -2
- rucio/web/rest/flaskapi/v1/dids.py +21 -15
- rucio/web/rest/flaskapi/v1/identities.py +33 -9
- rucio/web/rest/flaskapi/v1/redirect.py +5 -4
- rucio/web/rest/flaskapi/v1/replicas.py +12 -8
- rucio/web/rest/flaskapi/v1/rses.py +15 -4
- rucio/web/rest/flaskapi/v1/traces.py +56 -19
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.template +3 -19
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/requirements.server.txt +97 -68
- rucio-37.0.0rc2.data/scripts/rucio +133 -0
- rucio-37.0.0rc2.data/scripts/rucio-admin +97 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-atropos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-auditor +2 -1
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-automatix +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-client +17 -10
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-receiver +1 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-kronos +1 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos-temporary-expiration +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-necromancer +2 -2
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-reaper +6 -6
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-transmogrifier +2 -2
- rucio-37.0.0rc2.dist-info/METADATA +92 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/RECORD +239 -245
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/AUTHORS.rst +3 -0
- rucio/common/schema/atlas.py +0 -413
- rucio/common/schema/belleii.py +0 -408
- rucio/common/schema/domatpc.py +0 -401
- rucio/common/schema/escape.py +0 -426
- rucio/common/schema/icecube.py +0 -406
- rucio/core/permission/atlas.py +0 -1348
- rucio/core/permission/belleii.py +0 -1077
- rucio/core/permission/escape.py +0 -1078
- rucio/daemons/c3po/algorithms/__init__.py +0 -13
- rucio/daemons/c3po/algorithms/simple.py +0 -134
- rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
- rucio/daemons/c3po/c3po.py +0 -371
- rucio/daemons/c3po/collectors/agis.py +0 -108
- rucio/daemons/c3po/collectors/free_space.py +0 -81
- rucio/daemons/c3po/collectors/jedi_did.py +0 -57
- rucio/daemons/c3po/collectors/mock_did.py +0 -51
- rucio/daemons/c3po/collectors/network_metrics.py +0 -71
- rucio/daemons/c3po/collectors/workload.py +0 -112
- rucio/daemons/c3po/utils/__init__.py +0 -13
- rucio/daemons/c3po/utils/dataset_cache.py +0 -50
- rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
- rucio/daemons/c3po/utils/expiring_list.py +0 -62
- rucio/daemons/c3po/utils/popularity.py +0 -85
- rucio/daemons/c3po/utils/timeseries.py +0 -89
- rucio/rse/protocols/gsiftp.py +0 -92
- rucio-35.7.0.data/scripts/rucio-c3po +0 -85
- rucio-35.7.0.dist-info/METADATA +0 -72
- /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-account +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-bb8 +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dumper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-follower +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-hermes +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-injector +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-undertaker +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/WHEEL +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/LICENSE +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/top_level.txt +0 -0
|
@@ -15,22 +15,18 @@
|
|
|
15
15
|
"""
|
|
16
16
|
Conveyor is a daemon to manage file transfers.
|
|
17
17
|
"""
|
|
18
|
-
|
|
19
18
|
import json
|
|
20
19
|
import logging
|
|
21
|
-
import socket
|
|
22
20
|
import threading
|
|
23
21
|
import time
|
|
24
22
|
import traceback
|
|
25
|
-
from typing import TYPE_CHECKING, Any
|
|
26
|
-
|
|
27
|
-
import stomp
|
|
23
|
+
from typing import TYPE_CHECKING, Any
|
|
28
24
|
|
|
29
25
|
import rucio.db.sqla.util
|
|
30
26
|
from rucio.common import exception
|
|
31
|
-
from rucio.common.
|
|
32
|
-
from rucio.common.logging import setup_logging
|
|
27
|
+
from rucio.common.logging import formatted_logger, setup_logging
|
|
33
28
|
from rucio.common.policy import get_policy
|
|
29
|
+
from rucio.common.stomp_utils import Connection, ListenerBase, StompConnectionManager
|
|
34
30
|
from rucio.core import request as request_core
|
|
35
31
|
from rucio.core import transfer as transfer_core
|
|
36
32
|
from rucio.core.monitor import MetricManager
|
|
@@ -53,26 +49,22 @@ GRACEFUL_STOP = threading.Event()
|
|
|
53
49
|
DAEMON_NAME = 'conveyor-receiver'
|
|
54
50
|
|
|
55
51
|
|
|
56
|
-
class Receiver:
|
|
52
|
+
class Receiver(ListenerBase):
|
|
57
53
|
|
|
58
|
-
def __init__(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
def __init__(self,
|
|
55
|
+
conn: Connection,
|
|
56
|
+
id_: str,
|
|
57
|
+
total_threads: int,
|
|
58
|
+
transfer_stats_manager: request_core.TransferStatsManager,
|
|
59
|
+
all_vos: bool = False,
|
|
60
|
+
logger: "LoggerFunction" = logging.log,
|
|
61
|
+
**kwargs: dict) -> None:
|
|
62
|
+
super().__init__(conn, logger, **kwargs)
|
|
66
63
|
self.__all_vos = all_vos
|
|
67
|
-
self.__broker = broker
|
|
68
64
|
self.__id = id_
|
|
69
65
|
self.__total_threads = total_threads
|
|
70
66
|
self._transfer_stats_manager = transfer_stats_manager
|
|
71
67
|
|
|
72
|
-
@METRICS.count_it
|
|
73
|
-
def on_error(self, frame: "Frame") -> None:
|
|
74
|
-
logging.error('[%s] %s' % (self.__broker, frame.body))
|
|
75
|
-
|
|
76
68
|
@METRICS.count_it
|
|
77
69
|
def on_message(self, frame: "Frame") -> None:
|
|
78
70
|
msg = json.loads(frame.body) # type: ignore
|
|
@@ -86,7 +78,8 @@ class Receiver:
|
|
|
86
78
|
and 'issuer' in msg['job_metadata'].keys() \
|
|
87
79
|
and str(msg['job_metadata']['issuer']) == 'rucio':
|
|
88
80
|
|
|
89
|
-
if 'job_state' in msg.keys() and (str(msg['job_state']) != 'ACTIVE'
|
|
81
|
+
if ('job_state' in msg.keys() and (str(msg['job_state']) != 'ACTIVE'
|
|
82
|
+
or msg.get('job_multihop', False) is True)):
|
|
90
83
|
METRICS.counter('message_rucio').inc()
|
|
91
84
|
|
|
92
85
|
self._perform_request_update(msg)
|
|
@@ -96,13 +89,15 @@ class Receiver:
|
|
|
96
89
|
self,
|
|
97
90
|
msg: dict[str, Any],
|
|
98
91
|
*,
|
|
99
|
-
session:
|
|
92
|
+
session: "Session | None",
|
|
100
93
|
logger: "LoggerFunction" = logging.log
|
|
101
94
|
) -> None:
|
|
102
95
|
external_host = msg.get('endpnt', None)
|
|
103
96
|
request_id = msg['file_metadata'].get('request_id', None)
|
|
104
97
|
try:
|
|
105
|
-
tt_status_report = FTS3CompletionMessageTransferStatusReport(external_host,
|
|
98
|
+
tt_status_report = FTS3CompletionMessageTransferStatusReport(external_host,
|
|
99
|
+
request_id=request_id,
|
|
100
|
+
fts_message=msg)
|
|
106
101
|
if tt_status_report.get_db_fields_to_update(session=session, logger=logger): # type: ignore
|
|
107
102
|
logging.info('RECEIVED %s', tt_status_report)
|
|
108
103
|
|
|
@@ -120,103 +115,39 @@ class Receiver:
|
|
|
120
115
|
logging.critical(traceback.format_exc())
|
|
121
116
|
|
|
122
117
|
|
|
123
|
-
def receiver(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
) -> None:
|
|
118
|
+
def receiver(id_: str,
|
|
119
|
+
total_threads: int = 1,
|
|
120
|
+
all_vos: bool = False,
|
|
121
|
+
logger: "LoggerFunction" = logging.log):
|
|
128
122
|
"""
|
|
129
123
|
Main loop to consume messages from the FTS3 producer.
|
|
130
124
|
"""
|
|
125
|
+
logger(logging.INFO, 'receiver starting')
|
|
126
|
+
|
|
127
|
+
conn_mgr = StompConnectionManager(config_section='messaging-fts3', logger=logger)
|
|
131
128
|
|
|
132
|
-
logging.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
brokers_resolved = []
|
|
136
|
-
try:
|
|
137
|
-
brokers_alias = [b.strip() for b in config_get('messaging-fts3', 'brokers').split(',')]
|
|
138
|
-
except Exception:
|
|
139
|
-
raise Exception('Could not load brokers from configuration')
|
|
140
|
-
|
|
141
|
-
logging.info('resolving broker dns alias: %s' % brokers_alias)
|
|
142
|
-
|
|
143
|
-
brokers_resolved = []
|
|
144
|
-
for broker in brokers_alias:
|
|
145
|
-
addrinfos = socket.getaddrinfo(broker, 0, socket.AF_INET, 0, socket.IPPROTO_TCP)
|
|
146
|
-
brokers_resolved.extend(ai[4][0] for ai in addrinfos)
|
|
147
|
-
|
|
148
|
-
logging.info('brokers resolved to %s', brokers_resolved)
|
|
149
|
-
|
|
150
|
-
logging.info('checking authentication method')
|
|
151
|
-
use_ssl = True
|
|
152
|
-
try:
|
|
153
|
-
use_ssl = config_get_bool('messaging-fts3', 'use_ssl')
|
|
154
|
-
except:
|
|
155
|
-
logging.info('could not find use_ssl in configuration -- please update your rucio.cfg')
|
|
156
|
-
|
|
157
|
-
port = config_get_int('messaging-fts3', 'port')
|
|
158
|
-
vhost = config_get('messaging-fts3', 'broker_virtual_host', raise_exception=False)
|
|
159
|
-
if not use_ssl:
|
|
160
|
-
username = config_get('messaging-fts3', 'username')
|
|
161
|
-
password = config_get('messaging-fts3', 'password')
|
|
162
|
-
port = config_get_int('messaging-fts3', 'nonssl_port')
|
|
163
|
-
|
|
164
|
-
conns = []
|
|
165
|
-
for broker in brokers_resolved:
|
|
166
|
-
if not use_ssl:
|
|
167
|
-
logging.info('setting up username/password authentication: %s' % broker)
|
|
168
|
-
else:
|
|
169
|
-
logging.info('setting up ssl cert/key authentication: %s' % broker)
|
|
170
|
-
con = stomp.Connection12(host_and_ports=[(broker, port)],
|
|
171
|
-
vhost=vhost,
|
|
172
|
-
reconnect_attempts_max=999)
|
|
173
|
-
if use_ssl:
|
|
174
|
-
con.set_ssl(
|
|
175
|
-
key_file=config_get('messaging-fts3', 'ssl_key_file'),
|
|
176
|
-
cert_file=config_get('messaging-fts3', 'ssl_cert_file'),
|
|
177
|
-
)
|
|
178
|
-
conns.append(con)
|
|
179
|
-
|
|
180
|
-
logging.info('receiver started')
|
|
181
|
-
|
|
182
|
-
with (HeartbeatHandler(executable=DAEMON_NAME, renewal_interval=30) as heartbeat_handler,
|
|
129
|
+
logger(logging.INFO, 'receiver started')
|
|
130
|
+
|
|
131
|
+
with (HeartbeatHandler(executable=DAEMON_NAME, renewal_interval=30),
|
|
183
132
|
request_core.TransferStatsManager() as transfer_stats_manager):
|
|
133
|
+
|
|
134
|
+
conn_mgr.set_listener_factory('rucio-messaging-fts3', Receiver,
|
|
135
|
+
id_=id_,
|
|
136
|
+
total_threads=total_threads,
|
|
137
|
+
transfer_stats_manager=transfer_stats_manager,
|
|
138
|
+
all_vos=all_vos,
|
|
139
|
+
heartbeats=conn_mgr.config.heartbeats)
|
|
140
|
+
|
|
184
141
|
while not GRACEFUL_STOP.is_set():
|
|
185
142
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
for conn in conns:
|
|
189
|
-
|
|
190
|
-
if not conn.is_connected():
|
|
191
|
-
logger(logging.INFO, 'connecting to %s' % conn.transport._Transport__host_and_ports[0][0])
|
|
192
|
-
METRICS.counter('reconnect.{host}').labels(host=conn.transport._Transport__host_and_ports[0][0].split('.')[0]).inc()
|
|
193
|
-
|
|
194
|
-
conn.set_listener(
|
|
195
|
-
'rucio-messaging-fts3',
|
|
196
|
-
Receiver(
|
|
197
|
-
broker=conn.transport._Transport__host_and_ports[0],
|
|
198
|
-
id_=id_,
|
|
199
|
-
total_threads=total_threads,
|
|
200
|
-
transfer_stats_manager=transfer_stats_manager,
|
|
201
|
-
all_vos=all_vos
|
|
202
|
-
))
|
|
203
|
-
if not use_ssl:
|
|
204
|
-
conn.connect(username, password, wait=True)
|
|
205
|
-
else:
|
|
206
|
-
conn.connect(wait=True)
|
|
207
|
-
conn.subscribe(destination=config_get('messaging-fts3', 'destination'),
|
|
208
|
-
id='rucio-messaging-fts3',
|
|
209
|
-
ack='auto')
|
|
143
|
+
conn_mgr.subscribe(id_='rucio-messaging-fts3', ack='auto')
|
|
144
|
+
|
|
210
145
|
time.sleep(1)
|
|
211
146
|
|
|
212
|
-
|
|
213
|
-
try:
|
|
214
|
-
conn.disconnect()
|
|
215
|
-
except Exception:
|
|
216
|
-
pass
|
|
147
|
+
conn_mgr.disconnect()
|
|
217
148
|
|
|
218
149
|
|
|
219
|
-
def stop(signum:
|
|
150
|
+
def stop(signum: "int | None" = None, frame: "FrameType | None" = None) -> None:
|
|
220
151
|
"""
|
|
221
152
|
Graceful exit.
|
|
222
153
|
"""
|
|
@@ -224,26 +155,25 @@ def stop(signum: Optional[int] = None, frame: Optional["FrameType"] = None) -> N
|
|
|
224
155
|
GRACEFUL_STOP.set()
|
|
225
156
|
|
|
226
157
|
|
|
227
|
-
def run(
|
|
228
|
-
once: bool = False,
|
|
229
|
-
total_threads: int = 1
|
|
230
|
-
) -> None:
|
|
158
|
+
def run(once: bool = False, total_threads: int = 1) -> None:
|
|
231
159
|
"""
|
|
232
160
|
Starts up the receiver thread
|
|
233
161
|
"""
|
|
234
162
|
setup_logging(process_name=DAEMON_NAME)
|
|
163
|
+
logger = formatted_logger(logging.log, DAEMON_NAME + ' %s')
|
|
235
164
|
|
|
236
165
|
if rucio.db.sqla.util.is_old_db():
|
|
237
166
|
raise exception.DatabaseException('Database was not updated, daemon won\'t start')
|
|
238
167
|
|
|
239
|
-
logging.
|
|
240
|
-
threads = [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
168
|
+
logger(logging.INFO, 'starting receiver thread')
|
|
169
|
+
threads = []
|
|
170
|
+
for i in range(total_threads):
|
|
171
|
+
rec_thread = threading.Thread(target=receiver,
|
|
172
|
+
kwargs={'id_': i, 'logger': logger, 'total_threads': total_threads})
|
|
173
|
+
rec_thread.start()
|
|
174
|
+
threads.append(rec_thread)
|
|
244
175
|
|
|
245
|
-
logging.
|
|
176
|
+
logger(logging.INFO, 'waiting for interrupts')
|
|
246
177
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
threads = [thread.join(timeout=3.14) for thread in threads if thread and thread.is_alive()]
|
|
178
|
+
while [thread.join(timeout=3.14) for thread in threads if thread.is_alive()]:
|
|
179
|
+
pass
|
rucio/daemons/conveyor/stager.py
CHANGED
|
@@ -17,7 +17,6 @@ Conveyor transfer submitter is a daemon to manage non-tape file transfers.
|
|
|
17
17
|
"""
|
|
18
18
|
import logging
|
|
19
19
|
import threading
|
|
20
|
-
from collections.abc import Mapping
|
|
21
20
|
from typing import TYPE_CHECKING, Optional
|
|
22
21
|
|
|
23
22
|
import rucio.db.sqla.util
|
|
@@ -37,6 +36,7 @@ from rucio.transfertool.fts3 import FTS3Transfertool
|
|
|
37
36
|
from rucio.transfertool.globus import GlobusTransferTool
|
|
38
37
|
|
|
39
38
|
if TYPE_CHECKING:
|
|
39
|
+
from collections.abc import Mapping
|
|
40
40
|
from types import FrameType
|
|
41
41
|
|
|
42
42
|
from rucio.common.types import LoggerFunction, RSESettingsDict
|
|
@@ -114,7 +114,7 @@ def _fetch_requests(
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
def _handle_requests(
|
|
117
|
-
batch: tuple[Topology, Mapping[str, RequestWithSources]],
|
|
117
|
+
batch: tuple[Topology, 'Mapping[str, RequestWithSources]'],
|
|
118
118
|
*,
|
|
119
119
|
transfertools: list[str],
|
|
120
120
|
schemes: Optional[list[str]],
|
|
@@ -301,7 +301,7 @@ def submitter(
|
|
|
301
301
|
heartbeat_handler=heartbeat_handler,
|
|
302
302
|
)
|
|
303
303
|
|
|
304
|
-
def _consumer(batch: tuple[Topology, Mapping[str, RequestWithSources]]) -> None:
|
|
304
|
+
def _consumer(batch: tuple[Topology, 'Mapping[str, RequestWithSources]']) -> None:
|
|
305
305
|
return _handle_requests(
|
|
306
306
|
batch,
|
|
307
307
|
transfertools=transfertools,
|