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

[CouchDB] Do not sanitize couch url at the component layer #11045

Merged
merged 1 commit into from
Mar 18, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/python/WMComponent/JobAccountant/AccountantWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from WMCore.Database.CMSCouch import CouchServer
from WMCore.FwkJobReport.Report import Report
from WMCore.JobStateMachine.ChangeState import ChangeState
from WMCore.Lexicon import sanitizeURL
from WMCore.Services.WMStats.WMStatsWriter import WMStatsWriter
from WMCore.WMBS.File import File
from WMCore.WMBS.Job import Job
Expand Down Expand Up @@ -104,9 +103,8 @@ def __init__(self, config):
self.dataCollection = DataCollectionService(url=config.ACDC.couchurl,
database=config.ACDC.database)

jobDBurl = sanitizeURL(config.JobStateMachine.couchurl)['url']
self.jobDBName = config.JobStateMachine.couchDBName
self.jobCouchdb = CouchServer(jobDBurl)
self.jobCouchdb = CouchServer(config.JobStateMachine.couchurl)
self.fwjrCouchDB = None
self.localWMStats = WMStatsWriter(config.TaskArchiver.localWMStatsURL, appName="WMStatsAgent")

Expand Down
13 changes: 6 additions & 7 deletions src/python/WMComponent/TaskArchiver/CleanCouchPoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,23 @@ def setup(self, parameters=None):
self.centralRequestDBWriter = RequestDBWriter(self.config.AnalyticsDataCollector.localT0RequestDBURL,
couchapp=self.config.AnalyticsDataCollector.RequestCouchApp)

jobDBurl = sanitizeURL(self.config.JobStateMachine.couchurl)['url']
jobDBName = self.config.JobStateMachine.couchDBName
workDBName = getattr(self.config.TaskArchiver, 'workloadSummaryCouchDBName',
'workloadsummary')
workDBurl = getattr(self.config.TaskArchiver, 'workloadSummaryCouchURL')

self.jobCouchdb = CouchServer(jobDBurl)
self.jobCouchdb = CouchServer(self.config.JobStateMachine.couchurl)
self.jobsdatabase = self.jobCouchdb.connectDatabase("%s/jobs" % jobDBName)
self.fwjrdatabase = self.jobCouchdb.connectDatabase("%s/fwjrs" % jobDBName)
self.fwjrService = FWJRDBAPI(self.fwjrdatabase)

workDBName = getattr(self.config.TaskArchiver, 'workloadSummaryCouchDBName',
'workloadsummary')
workDBurl = getattr(self.config.TaskArchiver, 'workloadSummaryCouchURL')
self.workCouchdb = CouchServer(workDBurl)
self.workdatabase = self.workCouchdb.connectDatabase(workDBName)

statSummaryDBName = self.config.JobStateMachine.summaryStatsDBName
self.statsumdatabase = self.jobCouchdb.connectDatabase(statSummaryDBName)

logging.debug("Using url %s/%s for job", jobDBurl, jobDBName)
logging.debug("Using url %s/%s for job",
sanitizeURL(self.config.JobStateMachine.couchurl)['url'], jobDBName)
logging.debug("Writing to %s/%s for workloadSummary", sanitizeURL(workDBurl)['url'], workDBName)

@timeFunction
Expand Down
1 change: 1 addition & 0 deletions src/python/WMCore/Database/CMSCouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def makeRequest(self, uri=None, data=None, type='GET', incoming_headers=None,
TODO: set caching in the calling methods.
"""
incoming_headers = incoming_headers or {}
incoming_headers.update(self.additionalHeaders)
try:
if not cache:
incoming_headers.update({'Cache-Control': 'no-cache'})
Expand Down
2 changes: 1 addition & 1 deletion src/python/WMCore/WorkQueue/WorkQueueBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def insertWMSpec(self, wmspec):
def getWMSpec(self, name):
"""Get the spec"""
wmspec = WMWorkloadHelper()
wmspec.load(self.db['host'] + "/%s/%s/spec" % (self.db.name, name))
wmspec.load(self.hostWithAuth + "/%s/%s/spec" % (self.db.name, name))
return wmspec

def insertElements(self, units, parent=None):
Expand Down