WMCore
WMCore copied to clipboard
Add setter methods map to WMWorkload and call it for all reqArg parameters
Fixes #12038
Status
Ready
Description
With the current PR we add the new functionality to call all needed WMWorkload setter methods based on a full reqArgs
dictionary passed from the upper level caller and try to set all of parameters at once, rather than calling every single setter method one by one. This is achieved by creating a proper map between methods and possible request arguments. And later validating if the set of arguments passed with reqArgs
dictionary would properly match the signature of the setter method which is to be called. In the current implementation only a small set of methods is mapped to request parameters :
- setSiteWhiteList
- setSiteBlacklist
- setPriority (Mostly single argument parametrized methods, but that's ok for the time being, because those cover perfectly the functionality we need to plug in here)
With this change a path for updating all possible workqueue elements in a single go was opened. In the WorkQueue
service an additional method was developed for fetching all possible workqueue elements and update them all with the full set of arguments provided through the reqArgs
dictionary with the cost of a single database action per WorkQuee element, rather than 3 (or more) separate calls to the database for updating every single element parameter separately. Upon updating all workqueue elements with the new parameters the WMSpec copy of the given workflow at the workqueue is also updated in a single push using the same logic from above.
Is it backward compatible (if not, which system it affects?)
YES
Related PRs
None
External dependencies / deployment changes
None