Skip to content

Commit

Permalink
fix (DMS): workaround for xrootd setting rlimits
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Jan 8, 2025
1 parent f4d555c commit 774abc6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DIRAC/Resources/Storage/GFAL2_StorageBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from urllib import parse

from collections.abc import Iterator
from resource import getrlimit, setrlimit, RLIMIT_NPROC
from typing import cast, Literal, Union, Any, Optional

import gfal2 # pylint: disable=import-error
Expand Down Expand Up @@ -139,7 +140,12 @@ def __init__(self, storageName: str, parameters: dict[str, str]):
gfal2.set_verbose(gfal2.verbose_level.trace)

# # gfal2 API
# Workaround for https://github.com/xrootd/xrootd/issues/2396
# xrootd internaly sets nproc, so we save the limit and reset it
# just after creating the context
saved_limits = getrlimit(RLIMIT_NPROC)
self.ctx = gfal2.creat_context()
setrlimit(RLIMIT_NPROC, saved_limits)

# by default turn off BDII checks
self.ctx.set_opt_boolean("BDII", "ENABLE", False)
Expand Down

0 comments on commit 774abc6

Please sign in to comment.