Skip to content

Commit

Permalink
Merge pull request #12063 from amaltaro/bundle-2341
Browse files Browse the repository at this point in the history
Bundle of patches for WMAgent 2.3.4 series
  • Loading branch information
amaltaro authored Aug 2, 2024
2 parents df77c5c + c2b22ed commit 2383ea7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/python/WMCore/WMRuntime/Scripts/SetupCMSSWPset.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import pickle
import socket

from pprint import pformat
from PSetTweaks.PSetTweak import PSetTweak
from PSetTweaks.WMTweak import makeJobTweak, makeOutputTweak, makeTaskTweak, resizeResources
from Utils.Utilities import decodeBytesToUnicode, encodeUnicodeToBytes
Expand Down Expand Up @@ -705,11 +705,10 @@ def __call__(self):
raise ex

# Check process.source exists
self.logger.info("Debug: Self.process")
self.logger.info(dir(self.process))
if getattr(self.process, "source", None) is None and getattr(self.process, "_Process__source", None) is None:
msg = "Error in CMSSW PSet: process is missing attribute 'source'"
msg += " or process.source is defined with None value."
msg = "Error in CMSSW PSet: process object is either missing or has "
msg += "None value for attributes 'source' and '_Process__source'. "
msg += f"Details of process object are: {pformat(dir(self.process))}"
self.logger.error(msg)
raise RuntimeError(msg)

Expand Down
10 changes: 7 additions & 3 deletions src/python/WMCore/WorkQueue/WorkQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,14 @@ def _assignToChildQueue(self, queue, *elements):
ele['WMBSUrl'] = self.params["WMBSUrl"]
workByRequest.setdefault(ele['RequestName'], 0)
workByRequest[ele['RequestName']] += 1
work = self.parent_queue.saveElements(*elements)
self.logger.info("Assigned work to the child queue for:")
for reqName, numElem in viewitems(workByRequest):
self.logger.info("Setting GQE status to 'Negotiating' and assigning to this child queue for:")
for reqName, numElem in workByRequest.items():
self.logger.info(" %d elements for: %s", numElem, reqName)

work = self.parent_queue.saveElements(*elements)
self.logger.info("GQE successfully saved for:")
for ele in work:
self.logger.info(" %s under GQE id: %s", ele['RequestName'], ele.id)
return work

def doneWork(self, elementIDs=None, SubscriptionId=None, WorkflowName=None):
Expand Down
4 changes: 4 additions & 0 deletions src/python/WMCore/WorkQueue/WorkQueueBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ def _evalAvailableWork(self, listElems, thresholds, siteJobCounts,
if element['RequestName'] in excludeWorkflows:
msg = "Skipping aborted/force-completed workflow: %s, work id: %s"
self.logger.info(msg, element['RequestName'], element._id)
elif element['Status'] != 'Available':
# Extra safety mechanism, see https://github.com/dmwm/WMCore/pull/12050
msg = "Skipping element in unwanted status: %s, work id: %s"
self.logger.warning(msg, element['Status'], element._id)
else:
sortedElements.append(element)
sortAvailableElements(sortedElements)
Expand Down

0 comments on commit 2383ea7

Please sign in to comment.