Skip to content

Commit

Permalink
make Pre/Post/RetryJob use existing WEB_DIR. Fix #6994 (#6998)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored Jan 21, 2022
1 parent 4559446 commit 1ea5882
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
11 changes: 2 additions & 9 deletions src/python/TaskWorker/Actions/PostJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1329,15 +1329,8 @@ def get_defer_num(self):
## = = = = = PostJob = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

def create_taskwebdir(self):
## Create the task web directory in the schedd.
self.logpath = os.path.expanduser("~/%s" % (self.reqname))
try:
os.makedirs(self.logpath)
except OSError as ose:
if ose.errno != errno.EEXIST:
msg = "Failed to create log web-shared directory %s" % (self.logpath)
self.logger.error(msg)
raise
## The task web directory in the schedd has been created by AdjustSites.py
self.logpath = os.path.realpath('WEB_DIR')

## = = = = = PostJob = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Expand Down
11 changes: 2 additions & 9 deletions src/python/TaskWorker/Actions/PreJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,20 +442,13 @@ def redo_sites(self, new_submit_text, crab_retry, use_resubmit_info):

def touch_logs(self, crab_retry):
"""
Create the log web-shared directory for the task and create the
Use the log web-shared directory created by AdjustSites.py for the task and create the
job_out.<job_id>.<crab_retry>.txt and postjob.<job_id>.<crab_retry>.txt files
with default messages.
"""
try:
taskname = self.task_ad['CRAB_ReqName']
logpath = os.path.expanduser("~/%s" % (taskname))
try:
os.makedirs(logpath)
except OSError as oe:
if oe.errno != errno.EEXIST:
msg = "Failed to create log web-shared directory %s" % (logpath)
self.logger.info(msg)
return
logpath = os.path.relpath('WEB_DIR')
job_retry = "%s.%s" % (self.job_id, crab_retry)
fname = os.path.join(logpath, "job_out.%s.txt" % job_retry)
with open(fname, 'w') as fd:
Expand Down
4 changes: 2 additions & 2 deletions src/python/TaskWorker/Actions/RetryJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def check_exit_code(self):
if exitCode == 134:
recoverable_signal = False
try:
fname = os.path.expanduser("~/%s/job_out.%s.%d.txt" % (self.reqname, self.job_id, self.crab_retry))
fname = os.path.realpath("WEB_DIR/job_out.%s.%d.txt" % (self.job_id, self.crab_retry))
with open(fname) as fd:
for line in fd:
if line.startswith("== CMSSW: A fatal system signal has occurred: illegal instruction"):
Expand All @@ -338,7 +338,7 @@ def check_exit_code(self):
if exitCode == 8001 or exitCode == 65:
cvmfs_issue = False
try:
fname = os.path.expanduser("~/%s/job_out.%s.%d.txt" % (self.reqname, self.job_id, self.crab_retry))
fname = os.path.relpath("WEB_DIR/job_out.%s.%d.txt" % (self.job_id, self.crab_retry))
cvmfs_issue_re = re.compile("== CMSSW: unable to load /cvmfs/.*file too short")
with open(fname) as fd:
for line in fd:
Expand Down

0 comments on commit 1ea5882

Please sign in to comment.