Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a simple retry logic to das queries #10606

Merged
merged 1 commit into from Aug 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions Configuration/Applications/python/ConfigBuilder.py
Expand Up @@ -8,6 +8,7 @@
import sys
import re
import collections
from subprocess import Popen,PIPE
import FWCore.ParameterSet.DictTypes as DictTypes
class Options:
pass
Expand Down Expand Up @@ -122,12 +123,27 @@ def filesFromList(fileName,s=None):
return (prim,sec)

def filesFromDASQuery(query,s=None):
import os
import os,time
import FWCore.ParameterSet.Config as cms
prim=[]
sec=[]
print "the query is",query
for line in os.popen('das_client.py --query "%s"'%(query)):
eC=5
count=0
while eC!=0 and count<3:
if count!=0:
print 'Sleeping, then retrying DAS'
time.sleep(100)
p = Popen('das_client.py --query "%s"'%(query), stdout=PIPE,shell=True)
tupleP = os.waitpid(p.pid, 0)
eC=tupleP[1]
count=count+1
pipe=p.stdout.read()
if eC==0:
print "DAS succeeded after",count,"attempts",eC
else:
print "DAS failed 3 times- I give up"
for line in pipe.split('\n'):
if line.count(".root")>=2:
#two files solution...
entries=line.replace("\n","").split()
Expand Down
3 changes: 2 additions & 1 deletion Configuration/PyReleaseValidation/python/MatrixRunner.py
Expand Up @@ -60,7 +60,7 @@ def runTests(self, opt):
continue

print '\nPreparing to run %s %s' % (wf.numId, item)

sys.stdout.flush()
current = WorkFlowRunner(wf,noRun,dryRun,cafVeto, opt.dasOptions, opt.jobReports, opt.nThreads)
self.threadList.append(current)
current.start()
Expand Down Expand Up @@ -95,6 +95,7 @@ def count(collect,result):

report+=' '.join(map(str,totpassed))+' tests passed, '+' '.join(map(str,totfailed))+' failed\n'
print report
sys.stdout.flush()

runall_report_name='runall-report-step123-.log'
runall_report=open(runall_report_name,'w')
Expand Down