-
Notifications
You must be signed in to change notification settings - Fork 108
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
WorkloadTools.ValidateSiteLisits does not set empty lists by default. #12260
base: master
Are you sure you want to change the base?
WorkloadTools.ValidateSiteLisits does not set empty lists by default. #12260
Conversation
Jenkins results:
|
Jenkins results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for providing this fix. In addition to the comment along the code, I also have a comment on the WMWorkloadTools, but I'd rather have it here than along the code. So here it goes.
Even though that looks the way to go, I am not sure whether that is the correct system-wide fix.
When a workflow is created or assigned, the workflow factory is loaded and arguments are:
- set to a default value
- validated the data type
- validated the content
usually following the StdBase + sub-class spec. For the site lists, we use this definition for instance:
https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/WMSpec/StdSpecs/StdBase.py#L1147
so I am afraid that with this change, we will be either causing an error somewhere else or setting these to None as default.
I'd suggest to test/investigate those cases as well.
src/python/Utils/Utilities.py
Outdated
@@ -33,6 +33,8 @@ def makeList(stringList): | |||
throws a ValueError if the input is not well formed. | |||
If the stringList is already of type list, then return it untouched. | |||
""" | |||
# NOTE: In case of a change to this function beware of side effects which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the Utils
package is supposed to be agnostic of any WMCore-specific logic, I would suggest to remove this comment, please.
ok this:
Tells the whole story. This function has been already developed under the presumption there is no previously set parameters at the workflow. In addition to that, it will not only NOT work for updates of already existing parameters, but it would rather miss eventual I am going to change the code. And will not touch the old one in any way. It would be better in my opinion. |
…Workload.validateSiteListsUpdate method
Fixes #12250
Status
ready
Description
During the validation of the user provided
request_args
we have a step to mandatory check against the spec arguments from here:WMCore/src/python/WMCore/WMSpec/WMWorkload.py
Line 2074 in 0283414
and subsequently the
siteLists
from here:WMCore/src/python/WMCore/WMSpec/WMWorkloadTools.py
Line 294 in 0283414
Unfortunately the so defined function at
WMWorloadTools.validateSiteLists
sets thesitelists
to empty lists by default (even in the case they are completely missing from the so provided by the userrequest_args
):WMCore/src/python/WMCore/WMSpec/WMWorkloadTools.py
Lines 247 to 259 in 0283414
This causes the following behavior:
During the call to validate a dictionary of arguments provided by the user which is missing the
siteWhitelist
orSiteBlacklist
atReqMgr2
- here:WMCore/src/python/WMCore/ReqMgr/Utils/Validation.py
Line 116 in 0283414
The
siteLists
are set to empty lists before we enter the sequence of steps to update both the request atReqMgr
and all theWorkQueuElements
.Here is a printout of this effect produced by an interactive debugging session again together with @mapellidario:
This way the so produced empty lists enter as argument difference in
reqArgsDiff
and are considered as a change to emptySiteWhilist
andSiteBlacklist
and upon that updated in the workflow spec. Causing the so reported bug.Here is the result after applying the current patch:
It is obvious now that the
Request._handleNoStatusUpdate
method is called without the empty siteListsIs it backward compatible (if not, which system it affects?)
YES
Related PRs
The PR introducing the bug was: #12099
External dependencies / deployment changes
N/A