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

Check WMArchive doc size and cut off big docs #11967

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 14 additions & 2 deletions src/python/WMComponent/ArchiveDataReporter/ArchiveDataPoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import traceback
from Utils.IteratorTools import grouper
from Utils.Timers import timeFunction
from Utils.Utilities import getSize
from WMCore.WorkerThreads.BaseWorkerThread import BaseWorkerThread
from WMCore.Services.WMArchive.DataMap import createArchiverDoc
from WMCore.Services.WMArchive.WMArchive import WMArchive
Expand All @@ -24,6 +25,8 @@ def __init__(self, config):
"""
BaseWorkerThread.__init__(self)
self.config = config
# setup size threshold to fit CMSWEB nginx/frontend, i.e. 8MB
self.sizeThreshold = getattr(config.ArchiveDataReporter, "sizeThreshold", 8*1024*1024)

def setup(self, parameters):
"""
Expand Down Expand Up @@ -51,8 +54,17 @@ def algorithm(self, parameters):
archiveDocs = []
for job in slicedData:
doc = createArchiverDoc(job)
archiveDocs.append(doc)
jobIDs.append(job["id"])
# check document size before accepting to send to WMArchive service
size = getSize(doc)
if size > self.sizeThreshold:
shortDoc = {'id': doc['id'],
'fwjr': doc['doc']['fwjr'],
'jobtype': doc['doc']['jobtype'],
'jobstate': doc['doc']['jobstate']}
logging.warning("Created document is too large for WMArchive, size=%s thredshold=%s, document slice=%s", size, self.sizeThreshold, shortDoc)
else:
archiveDocs.append(doc)
jobIDs.append(job["id"])

response = self.wmarchiver.archiveData(archiveDocs)

Expand Down