Skip to content

Commit 728532a

Browse files
committed
Conflicts resolved with rel-v7r2
2 parents 0113ddb + 867a987 commit 728532a

File tree

13 files changed

+378
-127
lines changed

13 files changed

+378
-127
lines changed

integration_tests.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,24 @@ def create(
139139
prepare_environment(flags, editable, extra_module, release_var)
140140
install_server()
141141
install_client()
142-
error = 0
142+
exit_code = 0
143143
if run_server_tests:
144144
try:
145145
test_server()
146146
except TestExit as e:
147-
error += e.exit_code
147+
exit_code += e.exit_code
148148
else:
149149
raise NotImplementedError()
150150
if run_client_tests:
151151
try:
152152
test_client()
153153
except TestExit as e:
154-
error += e.exit_code
154+
exit_code += e.exit_code
155155
else:
156156
raise NotImplementedError()
157-
raise typer.Exit(0)
157+
if exit_code != 0:
158+
typer.secho("One or more tests failed", err=True, fg=c.RED)
159+
raise typer.Exit(exit_code)
158160

159161

160162
@app.command()

release.notes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ CHANGE: (#4937) removed StatesMonitoringAgent (use StatesAccountingAgent agent i
2828
*tests
2929
CHANGE: (#5046) don't use mail in the self generated certificates
3030

31+
[v7r2p5]
32+
33+
FIX: fixes from v7r0p56, v7r1p39
34+
35+
*WMS
36+
CHANGE: (#5102) JobCleaningAgent will first DELETE and only then REMOVE jobs
37+
3138
[v7r2p4]
3239

3340
*Core
@@ -199,6 +206,11 @@ NEW: (#4910) --runslow option on unit tests to allow faster local tests
199206
NEW: (#4938) added a helloworld test for the (yet to be implemented) cloud testing in certification
200207
CHANGE: (#4968) Change the defaults for tests (to MySQL 8 and ES 7)
201208

209+
[v7r1p39]
210+
211+
*WMS
212+
CHANGE: (#5121) for HTCondor, the SiteDirectory write the executable in the globally defined working directory
213+
202214
[v7r1p38]
203215

204216
FIX: fixes from v7r0p55
@@ -828,6 +840,14 @@ FIX: (#4551) align ProxyDB test to current changes
828840
NEW: (#4289) Document how to run integration tests in docker
829841
NEW: (#4551) add DNProperties description to Registry/Users subsection
830842

843+
[v7r0p56]
844+
845+
*Resources
846+
FIX: (#5119) HTCondorCE: Limit calls to actual cleanup (find and delete files on disk) to
847+
once per minute per SiteDirector, fixes #5118
848+
CHANGE: (#5119) HTCondorCE cleanup: Run the DIRAC_ executable purge with -O3 and -maxdepth
849+
1 to speed up the find
850+
831851
[v7r0p55]
832852

833853
*TS

src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
except ImportError:
6363
# Python 3's subprocess module contains a compatibility layer
6464
import subprocess as commands
65+
import datetime
6566
import errno
67+
import threading
6668

6769
from DIRAC import S_OK, S_ERROR, gConfig
6870
from DIRAC.Resources.Computing.ComputingElement import ComputingElement
@@ -164,6 +166,10 @@ class HTCondorCEComputingElement(ComputingElement):
164166
implementing the functions jobSubmit, getJobOutput
165167
"""
166168

169+
# static variables to ensure single cleanup every minute
170+
_lastCleanupTime = datetime.datetime.utcnow()
171+
_cleanupLock = threading.Lock()
172+
167173
#############################################################################
168174
def __init__(self, ceUniqueID):
169175
""" Standard constructor.
@@ -529,21 +535,33 @@ def __cleanup(self):
529535
# FIXME: again some issue with the working directory...
530536
# workingDirectory = self.ceParameters.get( 'WorkingDirectory', DEFAULT_WORKINGDIRECTORY )
531537

538+
if not HTCondorCEComputingElement._cleanupLock.acquire(False):
539+
return
540+
541+
now = datetime.datetime.utcnow()
542+
if (now - HTCondorCEComputingElement._lastCleanupTime).total_seconds() < 60:
543+
HTCondorCEComputingElement._cleanupLock.release()
544+
return
545+
546+
HTCondorCEComputingElement._lastCleanupTime = now
547+
532548
self.log.debug("Cleaning working directory: %s" % self.workingDirectory)
533549

534550
# remove all files older than 120 minutes starting with DIRAC_ Condor will
535551
# push files on submission, but it takes at least a few seconds until this
536552
# happens so we can't directly unlink after condor_submit
537-
status, stdout = commands.getstatusoutput('find %s -mmin +120 -name "DIRAC_*" -delete ' % self.workingDirectory)
553+
status, stdout = commands.getstatusoutput('find -O3 %s -maxdepth 1 -mmin +120 -name "DIRAC_*" -delete ' %
554+
self.workingDirectory)
538555
if status:
539556
self.log.error("Failure during HTCondorCE __cleanup", stdout)
540557

541-
# remove all out/err/log files older than "DaysToKeepLogs" days in the CE part of the working Directory
542-
workDir = os.path.join(self.workingDirectory, self.ceName)
543-
findPars = dict(workDir=workDir, days=self.daysToKeepLogs)
558+
# remove all out/err/log files older than "DaysToKeepLogs" days in the working directory
559+
# not running this for each CE so we do global cleanup
560+
findPars = dict(workDir=self.workingDirectory, days=self.daysToKeepLogs)
544561
# remove all out/err/log files older than "DaysToKeepLogs" days
545562
status, stdout = commands.getstatusoutput(
546563
r'find %(workDir)s -mtime +%(days)s -type f \( -name "*.out" -o -name "*.err" -o -name "*.log" \) -delete ' %
547564
findPars)
548565
if status:
549566
self.log.error("Failure during HTCondorCE __cleanup", stdout)
567+
self._cleanupLock.release()

0 commit comments

Comments
 (0)