Skip to content

Commit ed800d9

Browse files
chaenweb-flow
authored andcommitted
sweep: #7976 fix (DMS): workaround for xrootd setting rlimits
1 parent 3521703 commit ed800d9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DIRAC/Resources/Storage/GFAL2_StorageBase.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from urllib import parse
2828

2929
from collections.abc import Iterator
30+
from resource import getrlimit, setrlimit, RLIMIT_NPROC
3031
from typing import cast, Literal, Union, Any, Optional
3132

3233
import gfal2 # pylint: disable=import-error
@@ -138,7 +139,12 @@ def __init__(self, storageName: str, parameters: dict[str, str]):
138139
gfal2.set_verbose(gfal2.verbose_level.trace)
139140

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

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

0 commit comments

Comments
 (0)