Skip to content

Commit

Permalink
Conflicts resolved with rel-v7r2
Browse files Browse the repository at this point in the history
  • Loading branch information
atsareg committed Apr 28, 2021
2 parents 0113ddb + 867a987 commit 728532a
Show file tree
Hide file tree
Showing 13 changed files with 378 additions and 127 deletions.
10 changes: 6 additions & 4 deletions integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,24 @@ def create(
prepare_environment(flags, editable, extra_module, release_var)
install_server()
install_client()
error = 0
exit_code = 0
if run_server_tests:
try:
test_server()
except TestExit as e:
error += e.exit_code
exit_code += e.exit_code
else:
raise NotImplementedError()
if run_client_tests:
try:
test_client()
except TestExit as e:
error += e.exit_code
exit_code += e.exit_code
else:
raise NotImplementedError()
raise typer.Exit(0)
if exit_code != 0:
typer.secho("One or more tests failed", err=True, fg=c.RED)
raise typer.Exit(exit_code)


@app.command()
Expand Down
20 changes: 20 additions & 0 deletions release.notes
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ CHANGE: (#4937) removed StatesMonitoringAgent (use StatesAccountingAgent agent i
*tests
CHANGE: (#5046) don't use mail in the self generated certificates

[v7r2p5]

FIX: fixes from v7r0p56, v7r1p39

*WMS
CHANGE: (#5102) JobCleaningAgent will first DELETE and only then REMOVE jobs

[v7r2p4]

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

[v7r1p39]

*WMS
CHANGE: (#5121) for HTCondor, the SiteDirectory write the executable in the globally defined working directory

[v7r1p38]

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

[v7r0p56]

*Resources
FIX: (#5119) HTCondorCE: Limit calls to actual cleanup (find and delete files on disk) to
once per minute per SiteDirector, fixes #5118
CHANGE: (#5119) HTCondorCE cleanup: Run the DIRAC_ executable purge with -O3 and -maxdepth
1 to speed up the find

[v7r0p55]

*TS
Expand Down
26 changes: 22 additions & 4 deletions src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
except ImportError:
# Python 3's subprocess module contains a compatibility layer
import subprocess as commands
import datetime
import errno
import threading

from DIRAC import S_OK, S_ERROR, gConfig
from DIRAC.Resources.Computing.ComputingElement import ComputingElement
Expand Down Expand Up @@ -164,6 +166,10 @@ class HTCondorCEComputingElement(ComputingElement):
implementing the functions jobSubmit, getJobOutput
"""

# static variables to ensure single cleanup every minute
_lastCleanupTime = datetime.datetime.utcnow()
_cleanupLock = threading.Lock()

#############################################################################
def __init__(self, ceUniqueID):
""" Standard constructor.
Expand Down Expand Up @@ -529,21 +535,33 @@ def __cleanup(self):
# FIXME: again some issue with the working directory...
# workingDirectory = self.ceParameters.get( 'WorkingDirectory', DEFAULT_WORKINGDIRECTORY )

if not HTCondorCEComputingElement._cleanupLock.acquire(False):
return

now = datetime.datetime.utcnow()
if (now - HTCondorCEComputingElement._lastCleanupTime).total_seconds() < 60:
HTCondorCEComputingElement._cleanupLock.release()
return

HTCondorCEComputingElement._lastCleanupTime = now

self.log.debug("Cleaning working directory: %s" % self.workingDirectory)

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

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

0 comments on commit 728532a

Please sign in to comment.