rucio 37.5.0__py3-none-any.whl → 37.7.0__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.

Files changed (202) hide show
  1. rucio/cli/bin_legacy/rucio.py +41 -22
  2. rucio/cli/bin_legacy/rucio_admin.py +1 -1
  3. rucio/cli/did.py +2 -2
  4. rucio/cli/rse.py +2 -3
  5. rucio/cli/rule.py +9 -5
  6. rucio/cli/subscription.py +1 -1
  7. rucio/client/baseclient.py +9 -4
  8. rucio/client/didclient.py +16 -16
  9. rucio/client/downloadclient.py +16 -15
  10. rucio/client/exportclient.py +45 -4
  11. rucio/client/lockclient.py +3 -3
  12. rucio/client/pingclient.py +35 -4
  13. rucio/client/replicaclient.py +2 -2
  14. rucio/client/touchclient.py +3 -2
  15. rucio/client/uploadclient.py +728 -183
  16. rucio/common/cache.py +1 -2
  17. rucio/common/client.py +4 -30
  18. rucio/common/config.py +27 -3
  19. rucio/common/constants.py +5 -1
  20. rucio/common/didtype.py +2 -2
  21. rucio/common/dumper/__init__.py +1 -1
  22. rucio/common/pcache.py +20 -25
  23. rucio/common/plugins.py +12 -19
  24. rucio/common/policy.py +3 -2
  25. rucio/common/schema/__init__.py +11 -8
  26. rucio/common/types.py +7 -5
  27. rucio/common/utils.py +1 -1
  28. rucio/core/account.py +2 -1
  29. rucio/core/account_limit.py +3 -2
  30. rucio/core/authentication.py +1 -1
  31. rucio/core/credential.py +1 -1
  32. rucio/core/did.py +62 -61
  33. rucio/core/did_meta_plugins/__init__.py +10 -10
  34. rucio/core/did_meta_plugins/did_column_meta.py +9 -9
  35. rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
  36. rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
  37. rucio/core/did_meta_plugins/json_meta.py +2 -2
  38. rucio/core/did_meta_plugins/mongo_meta.py +9 -9
  39. rucio/core/did_meta_plugins/postgres_meta.py +7 -7
  40. rucio/core/dirac.py +3 -2
  41. rucio/core/distance.py +2 -1
  42. rucio/core/exporter.py +3 -2
  43. rucio/core/importer.py +5 -5
  44. rucio/core/lifetime_exception.py +2 -2
  45. rucio/core/lock.py +7 -7
  46. rucio/core/meta_conventions.py +2 -2
  47. rucio/core/monitor.py +1 -1
  48. rucio/core/naming_convention.py +1 -1
  49. rucio/core/nongrid_trace.py +2 -2
  50. rucio/core/oidc.py +2 -2
  51. rucio/core/permission/__init__.py +9 -6
  52. rucio/core/permission/generic.py +2 -2
  53. rucio/core/permission/generic_multi_vo.py +2 -2
  54. rucio/core/replica.py +22 -22
  55. rucio/core/request.py +2 -2
  56. rucio/core/rse.py +7 -7
  57. rucio/core/rule.py +38 -38
  58. rucio/core/rule_grouping.py +2 -3
  59. rucio/core/scope.py +1 -1
  60. rucio/core/trace.py +2 -2
  61. rucio/core/transfer.py +2 -2
  62. rucio/core/vo.py +2 -1
  63. rucio/daemons/atropos/atropos.py +2 -1
  64. rucio/daemons/auditor/__init__.py +1 -1
  65. rucio/daemons/automatix/automatix.py +5 -5
  66. rucio/daemons/badreplicas/minos.py +12 -5
  67. rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
  68. rucio/daemons/badreplicas/necromancer.py +9 -3
  69. rucio/daemons/bb8/bb8.py +2 -1
  70. rucio/daemons/bb8/common.py +1 -1
  71. rucio/daemons/bb8/nuclei_background_rebalance.py +3 -3
  72. rucio/daemons/bb8/t2_background_rebalance.py +1 -1
  73. rucio/daemons/cache/consumer.py +1 -1
  74. rucio/daemons/conveyor/common.py +3 -3
  75. rucio/daemons/conveyor/finisher.py +13 -4
  76. rucio/daemons/conveyor/poller.py +5 -2
  77. rucio/daemons/conveyor/receiver.py +1 -1
  78. rucio/daemons/conveyor/submitter.py +2 -1
  79. rucio/daemons/follower/follower.py +1 -1
  80. rucio/daemons/hermes/hermes.py +29 -8
  81. rucio/daemons/judge/cleaner.py +2 -2
  82. rucio/daemons/judge/evaluator.py +7 -7
  83. rucio/daemons/judge/injector.py +2 -2
  84. rucio/daemons/judge/repairer.py +2 -2
  85. rucio/daemons/reaper/dark_reaper.py +5 -4
  86. rucio/daemons/reaper/reaper.py +7 -7
  87. rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +4 -4
  88. rucio/daemons/storage/consistency/actions.py +3 -3
  89. rucio/daemons/tracer/kronos.py +3 -2
  90. rucio/daemons/transmogrifier/transmogrifier.py +71 -69
  91. rucio/daemons/undertaker/undertaker.py +8 -7
  92. rucio/db/sqla/constants.py +4 -3
  93. rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
  94. rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
  95. rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
  96. rucio/db/sqla/models.py +3 -3
  97. rucio/db/sqla/session.py +7 -7
  98. rucio/db/sqla/util.py +3 -2
  99. rucio/gateway/account.py +77 -101
  100. rucio/gateway/account_limit.py +90 -116
  101. rucio/gateway/authentication.py +9 -8
  102. rucio/gateway/config.py +11 -10
  103. rucio/gateway/credential.py +2 -1
  104. rucio/gateway/did.py +58 -58
  105. rucio/gateway/dirac.py +3 -2
  106. rucio/gateway/exporter.py +2 -1
  107. rucio/gateway/heartbeat.py +3 -2
  108. rucio/gateway/identity.py +4 -3
  109. rucio/gateway/importer.py +2 -1
  110. rucio/gateway/lifetime_exception.py +5 -4
  111. rucio/gateway/lock.py +6 -5
  112. rucio/gateway/meta_conventions.py +3 -2
  113. rucio/gateway/permission.py +2 -1
  114. rucio/gateway/quarantined_replica.py +2 -1
  115. rucio/gateway/replica.py +20 -20
  116. rucio/gateway/request.py +10 -10
  117. rucio/gateway/rse.py +27 -26
  118. rucio/gateway/rule.py +12 -11
  119. rucio/gateway/scope.py +4 -3
  120. rucio/gateway/subscription.py +7 -6
  121. rucio/gateway/vo.py +5 -4
  122. rucio/rse/__init__.py +7 -6
  123. rucio/rse/protocols/ngarc.py +2 -2
  124. rucio/rse/protocols/srm.py +1 -1
  125. rucio/rse/protocols/webdav.py +8 -1
  126. rucio/rse/rsemanager.py +5 -4
  127. rucio/rse/translation.py +2 -2
  128. rucio/tests/common.py +6 -5
  129. rucio/vcsversion.py +3 -3
  130. rucio/web/rest/flaskapi/v1/accountlimits.py +5 -5
  131. rucio/web/rest/flaskapi/v1/accounts.py +20 -20
  132. rucio/web/rest/flaskapi/v1/archives.py +4 -3
  133. rucio/web/rest/flaskapi/v1/common.py +5 -4
  134. rucio/web/rest/flaskapi/v1/dids.py +382 -331
  135. rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
  136. rucio/web/rest/flaskapi/v1/locks.py +13 -13
  137. rucio/web/rest/flaskapi/v1/main.py +1 -0
  138. rucio/web/rest/flaskapi/v1/redirect.py +2 -2
  139. rucio/web/rest/flaskapi/v1/replicas.py +16 -16
  140. rucio/web/rest/flaskapi/v1/requests.py +16 -16
  141. rucio/web/rest/flaskapi/v1/subscriptions.py +7 -7
  142. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-account +8 -1
  143. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-rse +8 -1
  144. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-auditor +1 -1
  145. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-throttler +7 -1
  146. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-follower +1 -1
  147. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-cleaner +9 -1
  148. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-necromancer +7 -1
  149. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-replica-recoverer +31 -9
  150. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-undertaker +8 -2
  151. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/METADATA +1 -1
  152. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/RECORD +202 -202
  153. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic.ini.template +0 -0
  154. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
  155. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  156. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  157. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  158. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  159. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  160. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  161. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  162. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  163. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  164. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
  165. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
  166. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
  167. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/requirements.server.txt +0 -0
  168. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/bootstrap.py +0 -0
  169. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  170. {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/reset_database.py +0 -0
  171. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio +0 -0
  172. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  173. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-admin +0 -0
  174. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-atropos +0 -0
  175. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-automatix +0 -0
  176. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-bb8 +0 -0
  177. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-client +0 -0
  178. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-consumer +0 -0
  179. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-finisher +0 -0
  180. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-poller +0 -0
  181. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-preparer +0 -0
  182. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-receiver +0 -0
  183. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-stager +0 -0
  184. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-submitter +0 -0
  185. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dark-reaper +0 -0
  186. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dumper +0 -0
  187. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-hermes +0 -0
  188. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-evaluator +0 -0
  189. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-injector +0 -0
  190. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-repairer +0 -0
  191. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-kronos +0 -0
  192. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos +0 -0
  193. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
  194. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-oauth-manager +0 -0
  195. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-reaper +0 -0
  196. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-rse-decommissioner +0 -0
  197. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  198. {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-transmogrifier +0 -0
  199. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/WHEEL +0 -0
  200. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/AUTHORS.rst +0 -0
  201. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/LICENSE +0 -0
  202. {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/top_level.txt +0 -0
@@ -18,7 +18,7 @@ This script is to be used to background rebalance ATLAS t2 datadisks
18
18
 
19
19
  from sqlalchemy import and_, or_, select
20
20
 
21
- from rucio.common.constants import RseAttr
21
+ from rucio.common.constants import DEFAULT_VO, RseAttr
22
22
  from rucio.core.rse import get_rse_attribute, get_rse_usage
23
23
  from rucio.core.rse_expression_parser import parse_expression
24
24
  from rucio.daemons.bb8.common import rebalance_rse
@@ -43,7 +43,7 @@ def group_space(site: str) -> int:
43
43
  group_total = 0
44
44
  try:
45
45
  site_groupdisks = parse_expression('site=%s&spacetoken=ATLASDATADISK&type=GROUPDISK' % site)
46
- except:
46
+ except Exception:
47
47
  return group_total
48
48
 
49
49
  for rse in site_groupdisks:
@@ -143,7 +143,7 @@ for source_rse in rses_over_ratio:
143
143
  if available_target_rebalance_volume >= available_source_rebalance_volume:
144
144
  available_target_rebalance_volume = available_source_rebalance_volume
145
145
 
146
- vo_str = 'on VO {}'.format(destination_rse['vo']) if destination_rse['vo'] != 'def' else 'def'
146
+ vo_str = 'on VO {}'.format(destination_rse['vo']) if destination_rse['vo'] != DEFAULT_VO else DEFAULT_VO
147
147
  print('Rebalance %dTB from %s(%f) to %s(%f)%s' % (available_target_rebalance_volume / 1E12, source_rse['rse'], source_rse['ratio'], destination_rse['rse'], destination_rse['ratio'], vo_str))
148
148
  expr = destination_rse['rse']
149
149
  rebalance_rse(rse_id=source_rse['id'], max_bytes=available_target_rebalance_volume, dry_run=False, comment='Nuclei Background rebalancing', force_expression=expr)
@@ -43,7 +43,7 @@ def group_space(site: str) -> int:
43
43
  group_total = 0
44
44
  try:
45
45
  site_groupdisks = parse_expression('site=%s&spacetoken=ATLASDATADISK&type=GROUPDISK' % site)
46
- except:
46
+ except Exception:
47
47
  return group_total
48
48
 
49
49
  for rse in site_groupdisks:
@@ -103,7 +103,7 @@ class AMQConsumer:
103
103
  else:
104
104
  self.__logger(logging.DEBUG, 'Check failed: %s %s '
105
105
  % (isinstance(msg, dict), 'operation' in msg.keys()))
106
- except:
106
+ except Exception:
107
107
  self.__logger(logging.ERROR, str(format_exc()))
108
108
 
109
109
 
@@ -24,7 +24,7 @@ import re
24
24
  from typing import TYPE_CHECKING, Any, Optional
25
25
 
26
26
  from rucio.common.config import config_get_bool
27
- from rucio.common.constants import RseAttr
27
+ from rucio.common.constants import DEFAULT_VO, RseAttr
28
28
  from rucio.common.exception import DatabaseException, DuplicateFileTransferSubmission, InvalidRSEExpression, RequestNotFound, TransferToolTimeout, TransferToolWrongAnswer, VONotFound
29
29
  from rucio.common.stopwatch import Stopwatch
30
30
  from rucio.core import request as request_core
@@ -510,7 +510,7 @@ def get_conveyor_rses(
510
510
  :param include_rses: RSEs to include
511
511
  :param exclude_rses: RSEs to exclude
512
512
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
513
- If None, we either use all VOs if run from "def", or the current VO otherwise.
513
+ If None, we either use all VOs if run from DEFAULT_VO, or the current VO otherwise.
514
514
  :param logger: Optional decorated logger that can be passed from the calling daemons or servers.
515
515
  :return: List of working rses
516
516
  """
@@ -518,7 +518,7 @@ def get_conveyor_rses(
518
518
  if not multi_vo:
519
519
  if vos:
520
520
  logger(logging.WARNING, 'Ignoring argument vos, this is only applicable in a multi-VO setup.')
521
- vos = ['def']
521
+ vos = [DEFAULT_VO]
522
522
  else:
523
523
  if vos:
524
524
  invalid = set(vos) - set([v['vo'] for v in list_vos()])
@@ -43,7 +43,7 @@ from rucio.core.rse import list_rses
43
43
  from rucio.core.topology import ExpiringObjectCache, Topology
44
44
  from rucio.core.transfer import ProtocolFactory
45
45
  from rucio.daemons.common import ProducerConsumerDaemon, db_workqueue
46
- from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, BadFilesStatus, ReplicaState, RequestState, RequestType
46
+ from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, BadFilesStatus, ReplicaState, RequestState, RequestType
47
47
  from rucio.db.sqla.session import transactional_session
48
48
 
49
49
  if TYPE_CHECKING:
@@ -140,7 +140,10 @@ def _handle_requests(
140
140
  logger(logging.DEBUG, 'Finish to update %s finished requests in %s seconds', len(reqs), total_stopwatch.elapsed)
141
141
 
142
142
  except (DatabaseException, DatabaseError) as error:
143
- if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0]) or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0]) or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]:
143
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
144
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
145
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
146
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
144
147
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
145
148
  else:
146
149
  raise
@@ -421,14 +424,20 @@ def __handle_terminated_replicas(
421
424
  try:
422
425
  __update_replica(replica, logger=logger)
423
426
  except (DatabaseException, DatabaseError) as error:
424
- if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0]) or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0]) or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]:
427
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
428
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
429
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
430
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
425
431
  logger(logging.WARNING, "Locks detected when handling replica %s:%s at RSE %s", replica['scope'], replica['name'], replica['rse_id'])
426
432
  else:
427
433
  logger(logging.ERROR, "Could not finish handling replicas %s:%s at RSE %s", replica['scope'], replica['name'], replica['rse_id'], exc_info=True)
428
434
  except Exception as error:
429
435
  logger(logging.ERROR, "Something unexpected happened when updating replica state for transfer %s:%s at %s (%s)", replica['scope'], replica['name'], replica['rse_id'], str(error))
430
436
  except (DatabaseException, DatabaseError) as error:
431
- if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0]) or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0]) or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]:
437
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
438
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
439
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
440
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
432
441
  logger(logging.WARNING, "Locks detected when handling replicas on %s rule %s, update updated time.", req_type, rule_id)
433
442
  try:
434
443
  request_core.touch_requests_by_rule(rule_id)
@@ -40,7 +40,7 @@ from rucio.core import transfer as transfer_core
40
40
  from rucio.core.monitor import MetricManager
41
41
  from rucio.core.topology import ExpiringObjectCache, Topology
42
42
  from rucio.daemons.common import ProducerConsumerDaemon, db_workqueue
43
- from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, RequestState, RequestType
43
+ from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, RequestState, RequestType
44
44
  from rucio.transfertool.fts3 import FTS3Transfertool
45
45
 
46
46
  if TYPE_CHECKING:
@@ -387,7 +387,10 @@ def _poll_transfers(
387
387
  # Otherwise if one bulk transfer includes many requests and one is not terminated, the transfer will be poll again.
388
388
  transfer_core.touch_transfer(transfertool_obj.external_host, transfer_id)
389
389
  except (DatabaseException, DatabaseError) as error:
390
- if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0]) or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0]) or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]:
390
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
391
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
392
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
393
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
391
394
  logger(logging.WARNING, "Lock detected when handling request %s - skipping" % transfer_id)
392
395
  else:
393
396
  logger(logging.ERROR, 'Exception', exc_info=True)
@@ -151,7 +151,7 @@ def receiver(
151
151
  use_ssl = True
152
152
  try:
153
153
  use_ssl = config_get_bool('messaging-fts3', 'use_ssl')
154
- except:
154
+ except Exception:
155
155
  logging.info('could not find use_ssl in configuration -- please update your rucio.cfg')
156
156
 
157
157
  port = config_get_int('messaging-fts3', 'port')
@@ -22,6 +22,7 @@ from typing import TYPE_CHECKING, Optional
22
22
  import rucio.db.sqla.util
23
23
  from rucio.common import exception
24
24
  from rucio.common.config import config_get, config_get_bool, config_get_float, config_get_int, config_get_list
25
+ from rucio.common.constants import DEFAULT_VO
25
26
  from rucio.common.logging import setup_logging
26
27
  from rucio.common.schema import get_schema_value
27
28
  from rucio.common.stopwatch import Stopwatch
@@ -370,7 +371,7 @@ def run(
370
371
  if exclude_activities:
371
372
  if not activities:
372
373
  if not multi_vo:
373
- vos = ['def']
374
+ vos = [DEFAULT_VO]
374
375
  if vos and len(vos) == 1:
375
376
  activities = get_schema_value('ACTIVITY', vos[0])
376
377
  elif vos and len(vos) > 1:
@@ -38,7 +38,7 @@ def aggregate_events(
38
38
  once: bool = False
39
39
  ) -> None:
40
40
  """
41
- Collect all the events affecting the dids followed by the corresponding account.
41
+ Collect all the events affecting the DIDs followed by the corresponding account.
42
42
  """
43
43
 
44
44
  logging.info('event_aggregation: started')
@@ -25,6 +25,7 @@ import random
25
25
  import re
26
26
  import smtplib
27
27
  import socket
28
+ import ssl
28
29
  import sys
29
30
  import threading
30
31
  import time
@@ -115,7 +116,7 @@ def setup_activemq(
115
116
  brokers_resolved = []
116
117
  try:
117
118
  brokers_alias = config_get_list("messaging-hermes", "brokers")
118
- except:
119
+ except Exception:
119
120
  raise Exception("Could not load brokers from configuration")
120
121
 
121
122
  logger(logging.INFO, "[broker] Resolving broker dns alias: %s", brokers_alias)
@@ -148,7 +149,7 @@ def setup_activemq(
148
149
  use_ssl = True
149
150
  try:
150
151
  use_ssl = config_get_bool("messaging-hermes", "use_ssl")
151
- except:
152
+ except Exception:
152
153
  logger(
153
154
  logging.INFO,
154
155
  "[broker] Could not find use_ssl in configuration -- please update your rucio.cfg",
@@ -343,6 +344,14 @@ def deliver_emails(
343
344
  :returns: List of message_id to delete
344
345
  """
345
346
 
347
+ smtp_host = config_get("messaging-hermes", "smtp_host")
348
+ smtp_port = config_get_int("messaging-hermes", "smtp_port", default=25)
349
+ smtp_username = config_get("messaging-hermes", "smtp_username", default='')
350
+ smtp_password = config_get("messaging-hermes", "smtp_password", default='')
351
+ smtp_certfile = config_get("messaging-hermes", "smtp_certfile", default='')
352
+ smtp_keyfile = config_get("messaging-hermes", "smtp_keyfile", default='')
353
+ smtp_usessl = config_get_bool("messaging-hermes", "smtp_usessl", default=False)
354
+ smtp_usetls = config_get_bool("messaging-hermes", "smtp_usetls", default=False)
346
355
  email_from = config_get("messaging-hermes", "email_from")
347
356
  send_email = config_get_bool(
348
357
  "messaging-hermes", "send_email", raise_exception=False, default=True
@@ -357,12 +366,24 @@ def deliver_emails(
357
366
 
358
367
  try:
359
368
  if send_email:
360
- smtp = smtplib.SMTP()
361
- smtp.connect()
362
- smtp.sendmail(
363
- msg["From"], message["payload"]["to"], msg.as_string()
364
- )
365
- smtp.quit()
369
+ ssl_context = None
370
+ if smtp_certfile and smtp_keyfile:
371
+ ssl_context = ssl.create_default_context()
372
+ ssl_context.load_cert_chain(certfile=smtp_certfile, keyfile=smtp_keyfile)
373
+
374
+ smtp_context = smtplib.SMTP(host=smtp_host, port=smtp_port)
375
+ if not smtp_usetls and smtp_usessl:
376
+ smtp_context = smtplib.SMTP_SSL(host=smtp_host, port=smtp_port, context=ssl_context)
377
+
378
+ with smtp_context as smtp_server:
379
+ if smtp_usetls:
380
+ smtp_server.ehlo() # not strictly necessary
381
+ smtp_server.starttls(context=ssl_context)
382
+ if smtp_username and smtp_password:
383
+ smtp_server.login(smtp_username, smtp_password)
384
+ smtp_server.sendmail(
385
+ msg["From"], message["payload"]["to"], msg.as_string()
386
+ )
366
387
  to_delete.append(message["id"])
367
388
  except Exception as error:
368
389
  logger(logging.ERROR, "Cannot send email : %s", str(error))
@@ -34,7 +34,7 @@ from rucio.common.logging import setup_logging
34
34
  from rucio.core.monitor import MetricManager
35
35
  from rucio.core.rule import delete_rule, get_expired_rules
36
36
  from rucio.daemons.common import HeartbeatHandler, run_daemon
37
- from rucio.db.sqla.constants import ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX
37
+ from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX
38
38
  from rucio.db.sqla.util import get_db_time
39
39
 
40
40
  if TYPE_CHECKING:
@@ -103,7 +103,7 @@ def run_once(
103
103
  delete_rule(rule_id=rule_id, nowait=True)
104
104
  logger(logging.DEBUG, 'deletion of %s took %f' % (rule_id, time.time() - start))
105
105
  except (DatabaseException, DatabaseError, UnsupportedOperation) as e:
106
- if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])):
106
+ if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(e.args[0])) or match(MYSQL_LOCK_NOWAIT_REGEX, str(e.args[0])):
107
107
  paused_rules[rule_id] = datetime.utcnow() + timedelta(seconds=randint(600, 2400)) # noqa: S311
108
108
  METRICS.counter('exceptions.{exception}').labels(exception='LocksDetected').inc()
109
109
  logger(logging.WARNING, 'Locks detected for %s' % rule_id)
@@ -36,7 +36,7 @@ from rucio.common.types import InternalScope
36
36
  from rucio.core.monitor import MetricManager
37
37
  from rucio.core.rule import delete_updated_did, get_updated_dids, re_evaluate_did
38
38
  from rucio.daemons.common import HeartbeatHandler, run_daemon
39
- from rucio.db.sqla.constants import ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, ORACLE_UNIQUE_CONSTRAINT_VIOLATED_REGEX
39
+ from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, ORACLE_UNIQUE_CONSTRAINT_VIOLATED_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX
40
40
 
41
41
  if TYPE_CHECKING:
42
42
  from types import FrameType
@@ -52,7 +52,7 @@ def re_evaluator(
52
52
  did_limit: int = 100
53
53
  ) -> None:
54
54
  """
55
- Main loop to check the re-evaluation of dids.
55
+ Main loop to check the re-evaluation of DIDs.
56
56
  """
57
57
 
58
58
  paused_dids = {} # {(scope, name): datetime}
@@ -81,13 +81,13 @@ def run_once(
81
81
  # heartbeat
82
82
  start = time.time() # NOQA
83
83
 
84
- # Refresh paused dids
84
+ # Refresh paused DIDs
85
85
  iter_paused_dids = copy.copy(paused_dids)
86
86
  for key in iter_paused_dids:
87
87
  if datetime.utcnow() > paused_dids[key]:
88
88
  del paused_dids[key]
89
89
 
90
- # Select a bunch of dids for re evaluation for this worker
90
+ # Select a bunch of DIDs for re-evaluation for this worker
91
91
  dids = get_updated_dids(total_workers=total_workers,
92
92
  worker_number=worker_number,
93
93
  limit=did_limit,
@@ -106,7 +106,7 @@ def run_once(
106
106
  if graceful_stop.is_set():
107
107
  break
108
108
 
109
- # Check if this did has already been operated on
109
+ # Check if this DID has already been operated on
110
110
  did_tag = '%s:%s' % (did.scope.internal, did.name)
111
111
  if did_tag in done_dids:
112
112
  if did.rule_evaluation_action in done_dids[did_tag]:
@@ -116,7 +116,7 @@ def run_once(
116
116
  else:
117
117
  done_dids[did_tag] = []
118
118
 
119
- # Jump paused dids
119
+ # Jump paused DIDs
120
120
  if (did.scope.internal, did.name) in paused_dids:
121
121
  continue
122
122
 
@@ -129,7 +129,7 @@ def run_once(
129
129
  except DataIdentifierNotFound:
130
130
  delete_updated_did(id_=did.id)
131
131
  except (DatabaseException, DatabaseError) as e:
132
- if match(ORACLE_UNIQUE_CONSTRAINT_VIOLATED_REGEX, str(e.args[0])) or match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])):
132
+ if match(ORACLE_UNIQUE_CONSTRAINT_VIOLATED_REGEX, str(e.args[0])) or match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(e.args[0])) or match(MYSQL_LOCK_NOWAIT_REGEX, str(e.args[0])):
133
133
  paused_dids[(did.scope.internal, did.name)] = datetime.utcnow() + timedelta(seconds=randint(60, 600)) # noqa: S311
134
134
  logger(logging.WARNING, 'Locks detected for %s:%s', did.scope, did.name)
135
135
  METRICS.counter('exceptions.{exception}').labels(exception='LocksDetected').inc()
@@ -33,7 +33,7 @@ from rucio.common.logging import setup_logging
33
33
  from rucio.core.monitor import MetricManager
34
34
  from rucio.core.rule import get_injected_rules, inject_rule, update_rule
35
35
  from rucio.daemons.common import HeartbeatHandler, run_daemon
36
- from rucio.db.sqla.constants import ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX
36
+ from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX
37
37
 
38
38
  if TYPE_CHECKING:
39
39
  from types import FrameType
@@ -99,7 +99,7 @@ def run_once(
99
99
  inject_rule(rule_id=rule_id, logger=logger)
100
100
  logger(logging.DEBUG, 'injection of %s took %f' % (rule_id, time.time() - start))
101
101
  except (DatabaseException, DatabaseError) as e:
102
- if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])):
102
+ if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(e.args[0])) or match(MYSQL_LOCK_NOWAIT_REGEX, str(e.args[0])):
103
103
  paused_rules[rule_id] = datetime.utcnow() + timedelta(seconds=randint(60, 600)) # noqa: S311
104
104
  METRICS.counter('exceptions.{exception}').labels(exception='LocksDetected').inc()
105
105
  logger(logging.WARNING, 'Locks detected for %s' % rule_id)
@@ -35,7 +35,7 @@ from rucio.common.logging import setup_logging
35
35
  from rucio.core.monitor import MetricManager
36
36
  from rucio.core.rule import get_stuck_rules, repair_rule
37
37
  from rucio.daemons.common import HeartbeatHandler, run_daemon
38
- from rucio.db.sqla.constants import ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX
38
+ from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_CONNECTION_LOST_CONTACT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX
39
39
 
40
40
  if TYPE_CHECKING:
41
41
  from types import FrameType
@@ -106,7 +106,7 @@ def run_once(
106
106
  repair_rule(rule_id=rule_id)
107
107
  logger(logging.DEBUG, 'repairing of %s took %f' % (rule_id, time.time() - start))
108
108
  except (DatabaseException, DatabaseError) as e:
109
- if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])):
109
+ if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(e.args[0])) or match(MYSQL_LOCK_NOWAIT_REGEX, str(e.args[0])):
110
110
  paused_rules[rule_id] = datetime.utcnow() + timedelta(seconds=randint(600, 2400)) # noqa: S311
111
111
  logger(logging.WARNING, 'Locks detected for %s' % (rule_id))
112
112
  METRICS.counter('exceptions.{exception}').labels(exception='LocksDetected').inc()
@@ -29,6 +29,7 @@ import rucio.core.rse as rse_core
29
29
  import rucio.db.sqla.util
30
30
  from rucio.common import exception
31
31
  from rucio.common.config import config_get_bool
32
+ from rucio.common.constants import DEFAULT_VO
32
33
  from rucio.common.exception import ResourceTemporaryUnavailable, RSEAccessDenied, RSENotFound, ServiceUnavailable, SourceNotFound, VONotFound
33
34
  from rucio.common.logging import setup_logging
34
35
  from rucio.core.message import add_message
@@ -145,7 +146,7 @@ def run_once(
145
146
  'url': pfn,
146
147
  'duration': duration,
147
148
  'protocol': prot.attributes['scheme']}
148
- if replica['scope'].vo != 'def':
149
+ if replica['scope'].vo != DEFAULT_VO:
149
150
  payload['vo'] = replica['scope'].vo
150
151
  add_message('deletion-done', payload)
151
152
  deleted_replicas.append(replica)
@@ -167,7 +168,7 @@ def run_once(
167
168
  'url': pfn,
168
169
  'reason': str(error),
169
170
  'protocol': prot.attributes['scheme']}
170
- if replica['scope'].vo != 'def':
171
+ if replica['scope'].vo != DEFAULT_VO:
171
172
  payload['vo'] = replica['scope'].vo
172
173
  add_message('deletion-failed', payload)
173
174
 
@@ -215,7 +216,7 @@ def run(
215
216
  :param exclude_rses: RSE expression to exclude RSEs from the Reaper.
216
217
  :param include_rses: RSE expression to include RSEs.
217
218
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
218
- If None, we either use all VOs if run from "def", or the current VO otherwise.
219
+ If None, we either use all VOs if run from DEFAULT_VO, or the current VO otherwise.
219
220
  """
220
221
  rses = rses or []
221
222
  setup_logging(process_name=DAEMON_NAME)
@@ -229,7 +230,7 @@ def run(
229
230
  if not multi_vo:
230
231
  if vos:
231
232
  logging.warning('Ignoring argument vos, this is only applicable in a multi-VO setup.')
232
- vos = ['def']
233
+ vos = [DEFAULT_VO]
233
234
  else:
234
235
  if vos:
235
236
  invalid = set(vos) - set([v['vo'] for v in list_vos()])
@@ -35,7 +35,7 @@ from sqlalchemy.exc import DatabaseError, IntegrityError
35
35
  import rucio.db.sqla.util
36
36
  from rucio.common.cache import MemcacheRegion
37
37
  from rucio.common.config import config_get_bool, config_get_int
38
- from rucio.common.constants import RseAttr
38
+ from rucio.common.constants import RseAttr, DEFAULT_VO
39
39
  from rucio.common.exception import DatabaseException, ReplicaNotFound, ReplicaUnAvailable, ResourceTemporaryUnavailable, RSEAccessDenied, RSENotFound, RSEProtocolNotSupported, ServiceUnavailable, SourceNotFound, VONotFound
40
40
  from rucio.common.logging import setup_logging
41
41
  from rucio.common.stopwatch import Stopwatch
@@ -81,7 +81,7 @@ def get_rses_to_process(
81
81
  :param exclude_rses: RSE expression to exclude RSEs from the Reaper.
82
82
  :param include_rses: RSE expression to include RSEs.
83
83
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
84
- If None, we either use all VOs if run from "def"
84
+ If None, we either use all VOs if run from DEFAULT_VO
85
85
 
86
86
  :returns: A list of RSEs to process
87
87
  """
@@ -89,7 +89,7 @@ def get_rses_to_process(
89
89
  if not multi_vo:
90
90
  if vos:
91
91
  logging.log(logging.WARNING, 'Ignoring argument vos, this is only applicable in a multi-VO setup.')
92
- vos = ['def']
92
+ vos = [DEFAULT_VO]
93
93
  else:
94
94
  if vos:
95
95
  invalid = set(vos) - set([v['vo'] for v in list_vos()])
@@ -156,7 +156,7 @@ def delete_from_storage(heartbeat_handler, hb_payload, replicas, prot, rse_info,
156
156
  'protocol': prot.attributes['scheme'],
157
157
  'datatype': replica['datatype']}
158
158
  try:
159
- if replica['scope'].vo != 'def':
159
+ if replica['scope'].vo != DEFAULT_VO:
160
160
  deletion_dict['vo'] = replica['scope'].vo
161
161
  logger(logging.DEBUG, 'Deletion ATTEMPT of %s:%s as %s on %s', replica['scope'], replica['name'], replica['pfn'], rse_name)
162
162
  # For STAGING RSEs, no physical deletion
@@ -232,7 +232,7 @@ def delete_from_storage(heartbeat_handler, hb_payload, replicas, prot, rse_info,
232
232
  'url': replica['pfn'],
233
233
  'reason': str(error),
234
234
  'protocol': prot.attributes['scheme']}
235
- if replica['scope'].vo != 'def':
235
+ if replica['scope'].vo != DEFAULT_VO:
236
236
  payload['vo'] = replica['scope'].vo
237
237
  add_message('deletion-failed', payload)
238
238
  logger(logging.INFO, 'Cannot connect to %s. RSE will be temporarily excluded.', rse_name)
@@ -400,7 +400,7 @@ def reaper(
400
400
  :param include_rses: RSE expression to include RSEs.
401
401
  :param exclude_rses: RSE expression to exclude RSEs from the Reaper.
402
402
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
403
- If None, we either use all VOs if run from "def", or the current VO otherwise.
403
+ If None, we either use all VOs if run from DEFAULT_VO, or the current VO otherwise.
404
404
  :param chunk_size: The size of chunk for deletion.
405
405
  :param once: If True, only runs one iteration of the main loop.
406
406
  :param greedy: If True, delete right away replicas with tombstone.
@@ -703,7 +703,7 @@ def run(
703
703
  :param exclude_rses: RSE expression to exclude RSEs from the Reaper.
704
704
  :param include_rses: RSE expression to include RSEs.
705
705
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
706
- If None, we either use all VOs if run from "def",
706
+ If None, we either use all VOs if run from DEFAULT_VO,
707
707
  or the current VO otherwise.
708
708
  :param delay_seconds: The delay to query replicas in BEING_DELETED state.
709
709
  :param sleep_time: Time between two cycles.
@@ -31,7 +31,7 @@ from typing import TYPE_CHECKING, Any, Optional
31
31
 
32
32
  import rucio.db.sqla.util
33
33
  from rucio.common.config import config_get, config_get_bool
34
- from rucio.common.constants import SuspiciousAvailability
34
+ from rucio.common.constants import DEFAULT_VO, SuspiciousAvailability
35
35
  from rucio.common.exception import DatabaseException, DuplicateRule, VONotFound
36
36
  from rucio.common.logging import setup_logging
37
37
  from rucio.common.types import InternalAccount, LoggerFunction
@@ -145,7 +145,7 @@ def declare_suspicious_replicas_bad(
145
145
  :param nattempts: The minimum number of appearances in the bad_replica DB table
146
146
  in order to appear in the resulting list of replicas for recovery.
147
147
  :param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
148
- If empty, we either use all VOs if run from "def",
148
+ If empty, we either use all VOs if run from DEFAULT_VO,
149
149
  :param limit_suspicious_files_on_rse: Maximum number of suspicious replicas on an RSE before that RSE
150
150
  is considered problematic and the suspicious replicas on that RSE
151
151
  are labeled as 'TEMPORARY_UNAVAILABLE'.
@@ -182,7 +182,7 @@ def run_once(heartbeat_handler: Any, younger_than: int, nattempts: int, vos: "Op
182
182
  if not multi_vo:
183
183
  if vos:
184
184
  logger(logging.WARNING, 'Ignoring argument vos, this is only applicable in a multi-VO setup.')
185
- vos = ['def']
185
+ vos = [DEFAULT_VO]
186
186
  else:
187
187
  if vos:
188
188
  invalid = set(vos) - set([v['vo'] for v in list_vos()])
@@ -198,7 +198,7 @@ def run_once(heartbeat_handler: Any, younger_than: int, nattempts: int, vos: "Op
198
198
  try:
199
199
  json_file = open(json_file_name, mode="r")
200
200
  logger(logging.INFO, "JSON file has been opened.")
201
- except:
201
+ except Exception:
202
202
  logger(logging.WARNING, "An error occurred while trying to open the JSON file.")
203
203
  must_sleep = True
204
204
  return must_sleep
@@ -166,7 +166,7 @@ class Stats:
166
166
  try:
167
167
  with open(self.path, "r") as f:
168
168
  data = f.read()
169
- except:
169
+ except Exception:
170
170
  data = ""
171
171
  data = json.loads(data or "{}")
172
172
  data.update(self.Data)
@@ -332,7 +332,7 @@ def was_cc_attempted(
332
332
  ) -> Optional[bool]:
333
333
  try:
334
334
  f = open(stats_file, "r")
335
- except:
335
+ except Exception:
336
336
  print("get_data: error ", stats_file)
337
337
  return None
338
338
  stats = json.loads(f.read())
@@ -347,7 +347,7 @@ def was_cc_processed(
347
347
  ) -> Optional[bool]:
348
348
  try:
349
349
  f = open(stats_file, "r")
350
- except:
350
+ except Exception:
351
351
  print("get_data: error ", stats_file)
352
352
  return None
353
353
  stats = json.loads(f.read())
@@ -30,6 +30,7 @@ from typing import TYPE_CHECKING, Optional
30
30
 
31
31
  import rucio.db.sqla.util
32
32
  from rucio.common.config import config_get, config_get_bool, config_get_int, config_get_list
33
+ from rucio.common.constants import DEFAULT_VO
33
34
  from rucio.common.exception import DatabaseException, RSENotFound
34
35
  from rucio.common.logging import setup_logging
35
36
  from rucio.common.stomp_utils import StompConnectionManager
@@ -143,7 +144,7 @@ class AMQConsumer:
143
144
  rses = []
144
145
  for report in self.__reports:
145
146
  if 'vo' not in report:
146
- report['vo'] = 'def'
147
+ report['vo'] = DEFAULT_VO
147
148
 
148
149
  try:
149
150
  # Identify suspicious files
@@ -299,7 +300,7 @@ class AMQConsumer:
299
300
  'usrdn': 'someuser',
300
301
  'clientState': 'DONE',
301
302
  'eventVersion': replica['eventVersion']}
302
- if replica['scope'].vo != 'def':
303
+ if replica['scope'].vo != DEFAULT_VO:
303
304
  resubmit['vo'] = replica['scope'].vo
304
305
  self.__conn.send(body=jdumps(resubmit), destination=self.__queue, headers={'appversion': 'rucio', 'resubmitted': '1'})
305
306
  METRICS.counter('sent_resubmitted').inc()