rucio 37.5.0__py3-none-any.whl → 37.6.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 (155) hide show
  1. rucio/cli/bin_legacy/rucio.py +1 -1
  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/subscription.py +1 -1
  6. rucio/client/baseclient.py +5 -1
  7. rucio/client/didclient.py +16 -16
  8. rucio/client/downloadclient.py +14 -14
  9. rucio/client/lockclient.py +3 -3
  10. rucio/client/replicaclient.py +2 -2
  11. rucio/client/touchclient.py +1 -1
  12. rucio/client/uploadclient.py +725 -181
  13. rucio/common/config.py +1 -2
  14. rucio/common/constants.py +2 -0
  15. rucio/common/didtype.py +2 -2
  16. rucio/common/dumper/__init__.py +1 -1
  17. rucio/common/pcache.py +20 -25
  18. rucio/common/plugins.py +10 -17
  19. rucio/common/schema/__init__.py +7 -5
  20. rucio/common/utils.py +1 -1
  21. rucio/core/authentication.py +1 -1
  22. rucio/core/credential.py +1 -1
  23. rucio/core/did.py +54 -54
  24. rucio/core/did_meta_plugins/__init__.py +10 -10
  25. rucio/core/did_meta_plugins/did_column_meta.py +9 -9
  26. rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
  27. rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
  28. rucio/core/did_meta_plugins/json_meta.py +2 -2
  29. rucio/core/did_meta_plugins/mongo_meta.py +9 -9
  30. rucio/core/did_meta_plugins/postgres_meta.py +7 -7
  31. rucio/core/dirac.py +1 -1
  32. rucio/core/lifetime_exception.py +2 -2
  33. rucio/core/lock.py +7 -7
  34. rucio/core/meta_conventions.py +2 -2
  35. rucio/core/monitor.py +1 -1
  36. rucio/core/naming_convention.py +1 -1
  37. rucio/core/nongrid_trace.py +2 -2
  38. rucio/core/oidc.py +2 -2
  39. rucio/core/permission/__init__.py +7 -5
  40. rucio/core/permission/generic.py +2 -2
  41. rucio/core/permission/generic_multi_vo.py +2 -2
  42. rucio/core/replica.py +17 -17
  43. rucio/core/rule.py +30 -30
  44. rucio/core/rule_grouping.py +2 -3
  45. rucio/core/scope.py +1 -1
  46. rucio/core/trace.py +2 -2
  47. rucio/daemons/auditor/__init__.py +1 -1
  48. rucio/daemons/badreplicas/minos.py +9 -3
  49. rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
  50. rucio/daemons/badreplicas/necromancer.py +9 -3
  51. rucio/daemons/bb8/common.py +1 -1
  52. rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
  53. rucio/daemons/bb8/t2_background_rebalance.py +1 -1
  54. rucio/daemons/cache/consumer.py +1 -1
  55. rucio/daemons/conveyor/finisher.py +13 -4
  56. rucio/daemons/conveyor/poller.py +5 -2
  57. rucio/daemons/conveyor/receiver.py +1 -1
  58. rucio/daemons/follower/follower.py +1 -1
  59. rucio/daemons/hermes/hermes.py +2 -2
  60. rucio/daemons/judge/cleaner.py +2 -2
  61. rucio/daemons/judge/evaluator.py +7 -7
  62. rucio/daemons/judge/injector.py +2 -2
  63. rucio/daemons/judge/repairer.py +2 -2
  64. rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +1 -1
  65. rucio/daemons/storage/consistency/actions.py +3 -3
  66. rucio/daemons/transmogrifier/transmogrifier.py +1 -1
  67. rucio/daemons/undertaker/undertaker.py +6 -6
  68. rucio/db/sqla/constants.py +4 -3
  69. rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
  70. rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
  71. rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
  72. rucio/db/sqla/models.py +1 -1
  73. rucio/db/sqla/session.py +7 -7
  74. rucio/gateway/account.py +65 -90
  75. rucio/gateway/did.py +26 -26
  76. rucio/gateway/dirac.py +1 -1
  77. rucio/gateway/lifetime_exception.py +1 -1
  78. rucio/gateway/replica.py +2 -2
  79. rucio/rse/protocols/ngarc.py +2 -2
  80. rucio/rse/protocols/srm.py +1 -1
  81. rucio/rse/protocols/webdav.py +8 -1
  82. rucio/tests/common.py +4 -4
  83. rucio/vcsversion.py +3 -3
  84. rucio/web/rest/flaskapi/v1/accounts.py +20 -20
  85. rucio/web/rest/flaskapi/v1/archives.py +2 -2
  86. rucio/web/rest/flaskapi/v1/common.py +1 -1
  87. rucio/web/rest/flaskapi/v1/dids.py +188 -188
  88. rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
  89. rucio/web/rest/flaskapi/v1/locks.py +13 -13
  90. rucio/web/rest/flaskapi/v1/main.py +1 -0
  91. rucio/web/rest/flaskapi/v1/redirect.py +2 -2
  92. rucio/web/rest/flaskapi/v1/replicas.py +16 -16
  93. rucio/web/rest/flaskapi/v1/requests.py +16 -16
  94. rucio/web/rest/flaskapi/v1/subscriptions.py +7 -7
  95. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-account +8 -1
  96. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-rse +8 -1
  97. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-auditor +1 -1
  98. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-throttler +7 -1
  99. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-follower +1 -1
  100. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-cleaner +9 -1
  101. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-necromancer +7 -1
  102. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-replica-recoverer +31 -9
  103. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-undertaker +8 -2
  104. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/METADATA +1 -1
  105. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/RECORD +155 -155
  106. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic.ini.template +0 -0
  107. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
  108. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  109. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  110. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  111. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  112. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  113. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  114. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  115. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  116. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  117. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
  118. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
  119. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
  120. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/requirements.server.txt +0 -0
  121. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/bootstrap.py +0 -0
  122. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  123. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/reset_database.py +0 -0
  124. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio +0 -0
  125. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  126. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-admin +0 -0
  127. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-atropos +0 -0
  128. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-automatix +0 -0
  129. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-bb8 +0 -0
  130. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-cache-client +0 -0
  131. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-cache-consumer +0 -0
  132. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-finisher +0 -0
  133. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-poller +0 -0
  134. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-preparer +0 -0
  135. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-receiver +0 -0
  136. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-stager +0 -0
  137. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-submitter +0 -0
  138. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-dark-reaper +0 -0
  139. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-dumper +0 -0
  140. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-hermes +0 -0
  141. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-evaluator +0 -0
  142. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-injector +0 -0
  143. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-repairer +0 -0
  144. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-kronos +0 -0
  145. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-minos +0 -0
  146. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
  147. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-oauth-manager +0 -0
  148. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-reaper +0 -0
  149. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-rse-decommissioner +0 -0
  150. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  151. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-transmogrifier +0 -0
  152. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/WHEEL +0 -0
  153. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/licenses/AUTHORS.rst +0 -0
  154. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/licenses/LICENSE +0 -0
  155. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/top_level.txt +0 -0
@@ -247,7 +247,7 @@ def check(
247
247
  results_dir)
248
248
  if output:
249
249
  process_output(output)
250
- except:
250
+ except Exception:
251
251
  elapsed = (datetime.now() - start).total_seconds() / 60
252
252
  logger.error('Check of "%s" failed in %d minutes, %d remaining attempts', rse, elapsed, attempts, exc_info=True)
253
253
  success = False
@@ -31,7 +31,7 @@ from rucio.core.did import get_metadata
31
31
  from rucio.core.replica import bulk_add_bad_replicas, bulk_delete_bad_pfns, declare_bad_file_replicas, get_bad_pfns, get_did_from_pfns, get_pfn_to_rse, get_replicas_state, update_replicas_states
32
32
  from rucio.core.rse import get_rse_name
33
33
  from rucio.daemons.common import run_daemon
34
- from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, BadFilesStatus, BadPFNStatus, ReplicaState
34
+ 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, BadPFNStatus, ReplicaState
35
35
  from rucio.db.sqla.session import get_session
36
36
 
37
37
  if TYPE_CHECKING:
@@ -220,7 +220,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
220
220
  bulk_delete_bad_pfns(pfns=chunk, session=session)
221
221
  session.commit() # pylint: disable=no-member
222
222
  except (DatabaseException, DatabaseError) as error:
223
- 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]:
223
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
224
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
225
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
226
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
224
227
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
225
228
  else:
226
229
  logger(logging.ERROR, 'Exception', exc_info=True)
@@ -273,7 +276,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
273
276
  __update_temporary_unavailable(chunk=chunk, reason=reason, expires_at=expires_at, account=account, logger=logger)
274
277
  session = get_session()
275
278
  except (DatabaseException, DatabaseError) as error:
276
- 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]:
279
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
280
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
281
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
282
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
277
283
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
278
284
  else:
279
285
  logger(logging.ERROR, 'Exception', exc_info=True)
@@ -30,7 +30,7 @@ from rucio.common.utils import chunks
30
30
  from rucio.core.did import get_metadata
31
31
  from rucio.core.replica import bulk_delete_bad_replicas, get_replicas_state, list_expired_temporary_unavailable_replicas, update_replicas_states
32
32
  from rucio.daemons.common import run_daemon
33
- from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, BadFilesStatus, ReplicaState
33
+ 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
34
34
  from rucio.db.sqla.session import get_session
35
35
 
36
36
  if TYPE_CHECKING:
@@ -127,7 +127,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
127
127
  session.commit() # pylint: disable=no-member
128
128
  session = get_session()
129
129
  except (DatabaseException, DatabaseError) as error:
130
- 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]:
130
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
131
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
132
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
133
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
131
134
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
132
135
  else:
133
136
  logger(logging.ERROR, 'Exception', exc_info=True)
@@ -33,7 +33,7 @@ from rucio.core.monitor import MetricManager
33
33
  from rucio.core.replica import get_bad_replicas_backlog, get_replicas_state, list_bad_replicas
34
34
  from rucio.core.rule import get_evaluation_backlog, update_rules_for_bad_replica, update_rules_for_lost_replica
35
35
  from rucio.daemons.common import HeartbeatHandler, run_daemon
36
- from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, ReplicaState
36
+ 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, ReplicaState
37
37
 
38
38
  if TYPE_CHECKING:
39
39
  from types import FrameType
@@ -136,7 +136,10 @@ def run_once(heartbeat_handler: HeartbeatHandler, bulk: int, **_kwargs) -> bool:
136
136
  update_rules_for_lost_replica(scope=scope, name=name, rse_id=rse_id, nowait=True)
137
137
  METRICS.counter(name='badfiles.lostfile').inc()
138
138
  except (DatabaseException, DatabaseError) as error:
139
- 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]:
139
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
140
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
141
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
142
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
140
143
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
141
144
  else:
142
145
  logger(logging.ERROR, str(error))
@@ -149,7 +152,10 @@ def run_once(heartbeat_handler: HeartbeatHandler, bulk: int, **_kwargs) -> bool:
149
152
  update_rules_for_bad_replica(scope=scope, name=name, rse_id=rse_id, nowait=True)
150
153
  METRICS.counter(name='badfiles.recovering').inc()
151
154
  except (DatabaseException, DatabaseError) as error:
152
- 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]:
155
+ if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
156
+ or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
157
+ or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
158
+ or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
153
159
  logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
154
160
  else:
155
161
  logger(logging.ERROR, str(error))
@@ -279,7 +279,7 @@ def list_rebalance_rule_candidates(
279
279
 
280
280
  vo = get_rse_vo(rse_id=rse_id)
281
281
 
282
- # dumps can be applied only for decommission since the dumps doesn't contain info from dids
282
+ # dumps can be applied only for decommission since the dumps doesn't contain info from DIDs
283
283
  if mode == "decommission":
284
284
  return _list_rebalance_rule_candidates_dump(rse_id, mode)
285
285
 
@@ -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:
@@ -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
 
@@ -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')
@@ -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')
@@ -115,7 +115,7 @@ def setup_activemq(
115
115
  brokers_resolved = []
116
116
  try:
117
117
  brokers_alias = config_get_list("messaging-hermes", "brokers")
118
- except:
118
+ except Exception:
119
119
  raise Exception("Could not load brokers from configuration")
120
120
 
121
121
  logger(logging.INFO, "[broker] Resolving broker dns alias: %s", brokers_alias)
@@ -148,7 +148,7 @@ def setup_activemq(
148
148
  use_ssl = True
149
149
  try:
150
150
  use_ssl = config_get_bool("messaging-hermes", "use_ssl")
151
- except:
151
+ except Exception:
152
152
  logger(
153
153
  logging.INFO,
154
154
  "[broker] Could not find use_ssl in configuration -- please update your rucio.cfg",
@@ -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()
@@ -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())
@@ -492,7 +492,7 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
492
492
  # List all the active subscriptions
493
493
  subscriptions = get_subscriptions(logger=logger)
494
494
 
495
- # Loop over all the new dids
495
+ # Loop over all the new DIDs
496
496
  # Get the new DIDs based on the is_new flag
497
497
  logger(logging.DEBUG, "Listing new dids")
498
498
  for did in list_new_dids(
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  '''
16
- Undertaker is a daemon to manage expired did.
16
+ Undertaker is a daemon to manage expired DID.
17
17
  '''
18
18
 
19
19
  import functools
@@ -36,7 +36,7 @@ from rucio.common.utils import chunks
36
36
  from rucio.core.did import delete_dids, list_expired_dids
37
37
  from rucio.core.monitor import MetricManager
38
38
  from rucio.daemons.common import HeartbeatHandler, run_daemon
39
- from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_LOCK_NOT_AVAILABLE_REGEX
39
+ from rucio.db.sqla.constants import MYSQL_LOCK_NOWAIT_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_LOCK_NOT_AVAILABLE_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX
40
40
 
41
41
  if TYPE_CHECKING:
42
42
  from types import FrameType
@@ -51,7 +51,7 @@ DAEMON_NAME = 'undertaker'
51
51
 
52
52
  def undertaker(once: bool = False, sleep_time: int = 60, chunk_size: int = 10) -> None:
53
53
  """
54
- Main loop to select and delete dids.
54
+ Main loop to select and delete DIDs.
55
55
  """
56
56
  paused_dids = {} # {(scope, name): datetime}
57
57
  run_daemon(
@@ -72,7 +72,7 @@ def run_once(paused_dids: dict[tuple, datetime], chunk_size: int, heartbeat_hand
72
72
  worker_number, total_workers, logger = heartbeat_handler.live()
73
73
 
74
74
  try:
75
- # Refresh paused dids
75
+ # Refresh paused DIDs
76
76
  iter_paused_dids = deepcopy(paused_dids)
77
77
  for key in iter_paused_dids:
78
78
  if datetime.utcnow() > paused_dids[key]:
@@ -96,14 +96,14 @@ def run_once(paused_dids: dict[tuple, datetime], chunk_size: int, heartbeat_hand
96
96
  except RuleNotFound as error:
97
97
  logger(logging.ERROR, error)
98
98
  except (DatabaseException, DatabaseError, UnsupportedOperation) as e:
99
- if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_LOCK_NOT_AVAILABLE_REGEX, str(e.args[0])) or match(MYSQL_LOCK_NOWAIT_REGEX, str(e.args[0])):
99
+ if match(ORACLE_RESOURCE_BUSY_REGEX, str(e.args[0])) or match(PSQL_LOCK_NOT_AVAILABLE_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])):
100
100
  for did in chunk:
101
101
  paused_dids[(did['scope'], did['name'])] = datetime.utcnow() + timedelta(seconds=randint(600, 2400)) # noqa: S311
102
102
  METRICS.counter('delete_dids.exceptions.{exception}').labels(exception='LocksDetected').inc()
103
103
  logger(logging.WARNING, 'Locks detected for chunk')
104
104
  else:
105
105
  logger(logging.ERROR, 'Got database error %s.', str(e))
106
- except:
106
+ except Exception:
107
107
  logging.critical(traceback.format_exc())
108
108
 
109
109
 
@@ -26,6 +26,7 @@ ORACLE_DEADLOCK_DETECTED_REGEX = r".*ORA-00060.*"
26
26
  ORACLE_RESOURCE_BUSY_REGEX = r".*ORA-00054.*"
27
27
  ORACLE_UNIQUE_CONSTRAINT_VIOLATED_REGEX = r".*ORA-00001.*"
28
28
  PSQL_LOCK_NOT_AVAILABLE_REGEX = r".*55P03.*"
29
+ PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX = r".*psycopg.errors.LockNotAvailable.*"
29
30
  MYSQL_LOCK_NOWAIT_REGEX = r".*3572.*"
30
31
  MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED = "ERROR 1205 (HY000)"
31
32
 
@@ -196,9 +197,9 @@ class SubscriptionState(Enum):
196
197
  BROKEN = 'B'
197
198
 
198
199
 
199
- #class TransferLimitDirection(Enum):
200
- # SOURCE = 'S'
201
- # DESTINATION = 'D'
200
+ # class TransferLimitDirection(Enum):
201
+ # SOURCE = 'S'
202
+ # DESTINATION = 'D'
202
203
 
203
204
 
204
205
  class DatabaseOperationType(Enum):
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- ''' add convention table and closed_at to dids '''
15
+ ''' add convention table and closed_at to DIDs '''
16
16
 
17
17
  import datetime
18
18
 
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- ''' remove temporary dids '''
15
+ ''' remove temporary DIDs '''
16
16
 
17
17
  import sqlalchemy as sa
18
18
  from alembic import context
@@ -12,7 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- ''' add lumiblocknr to dids '''
15
+ ''' add lumiblocknr to DIDs '''
16
16
 
17
17
  import sqlalchemy as sa
18
18
  from alembic import context
rucio/db/sqla/models.py CHANGED
@@ -563,7 +563,7 @@ class DeletedDataIdentifier(BASE, ModelBase):
563
563
 
564
564
 
565
565
  class UpdatedDID(BASE, ModelBase):
566
- """Represents the recently updated dids"""
566
+ """Represents the recently updated DIDs"""
567
567
  __tablename__ = 'updated_dids'
568
568
  id: Mapped[str] = mapped_column(GUID(), default=utils.generate_uuid)
569
569
  scope: Mapped[InternalScope] = mapped_column(InternalScopeString(common_schema.get_schema_value('SCOPE_LENGTH')))
rucio/db/sqla/session.py CHANGED
@@ -54,7 +54,7 @@ if TYPE_CHECKING:
54
54
  try:
55
55
  main_script = os.path.basename(sys.argv[0])
56
56
  CURRENT_COMPONENT = main_script.split('-')[1]
57
- except:
57
+ except Exception:
58
58
  CURRENT_COMPONENT = None
59
59
 
60
60
  DATABASE_SECTION = 'database'
@@ -63,7 +63,7 @@ try:
63
63
  sql_connection = config_get('%s-database' % CURRENT_COMPONENT, 'default', check_config_table=False).strip()
64
64
  if sql_connection and len(sql_connection):
65
65
  DATABASE_SECTION = '%s-database' % CURRENT_COMPONENT
66
- except:
66
+ except Exception:
67
67
  pass
68
68
 
69
69
  DEFAULT_SCHEMA_NAME = config_get(DATABASE_SECTION, 'schema',
@@ -221,7 +221,7 @@ def get_engine() -> 'Engine':
221
221
  for param, param_type in config_params:
222
222
  try:
223
223
  params[param] = param_type(config_get(DATABASE_SECTION, param, check_config_table=False))
224
- except:
224
+ except Exception:
225
225
  pass
226
226
  _ENGINE = create_engine(sql_connection, **params)
227
227
  if 'mysql' in sql_connection:
@@ -406,7 +406,7 @@ def read_session(function: "Callable[P, R]"):
406
406
  except DatabaseError as error:
407
407
  session.rollback() # type: ignore
408
408
  raise DatabaseException(str(error))
409
- except:
409
+ except Exception:
410
410
  session.rollback() # type: ignore
411
411
  raise
412
412
  finally:
@@ -451,7 +451,7 @@ def stream_session(function: "Callable[P, R]"):
451
451
  except DatabaseError as error:
452
452
  session.rollback() # type: ignore
453
453
  raise DatabaseException(str(error))
454
- except:
454
+ except Exception:
455
455
  session.rollback() # type: ignore
456
456
  raise
457
457
  finally:
@@ -460,7 +460,7 @@ def stream_session(function: "Callable[P, R]"):
460
460
  try:
461
461
  for row in function(*args, session=session, **kwargs):
462
462
  yield row
463
- except:
463
+ except Exception:
464
464
  raise
465
465
  return _update_session_wrapper(new_funct, function)
466
466
 
@@ -491,7 +491,7 @@ def transactional_session(function: "Callable[P, R]") -> 'Callable':
491
491
  except DatabaseError as error:
492
492
  session.rollback() # type: ignore
493
493
  raise DatabaseException(str(error))
494
- except:
494
+ except Exception:
495
495
  session.rollback() # type: ignore
496
496
  raise
497
497
  finally: