Handle undefined resource names#194
Merged
matyasselmeci merged 1 commit intoopensciencegrid:2.xfrom Feb 5, 2026
Merged
Conversation
mwestphall
reviewed
Feb 5, 2026
Contributor
mwestphall
left a comment
There was a problem hiding this comment.
Hi @dsschult , I've left a couple comments on this PR.
| @@ -565,7 +565,7 @@ def cream_match(match, desired): | |||
| def get_classad_resource_name(classad): | |||
| for attr in RESOURCE_NAME_ATTRS: | |||
| resource_name = classad.get(attr) | |||
Contributor
There was a problem hiding this comment.
Suggested change
| resource_name = classad.get(attr) | |
| resource_name = classad.eval(attr) |
Contributor
There was a problem hiding this comment.
Eval is more robust than get here in case the classads are not literal values
| for attr in RESOURCE_NAME_ATTRS: | ||
| resource_name = classad.get(attr) | ||
| if resource_name: | ||
| if resource_name and resource_name not in (classadLib.Value.Undefined, classadLib.Value.Error): |
Contributor
There was a problem hiding this comment.
Suggested change
| if resource_name and resource_name not in (classadLib.Value.Undefined, classadLib.Value.Error): | |
| if resource_name and resource_name is not classadLib.Value.Undefined and resource_name is not classadLib.Value.Error: |
Contributor
There was a problem hiding this comment.
Per the HTCondor dev team, you need to use identity comparisons to check against classadLib.Value values since they're just integers
mwestphall
requested changes
Feb 5, 2026
Contributor
mwestphall
left a comment
There was a problem hiding this comment.
Requesting a couple changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the resource name classad exists but is set to the value
classad.Value.Undefined(we appear to have this when flocking to CHTC directly), allow processing to continue.Example of classads:
Before this PR, it would look at
MachineAttrGLIDEIN_ResourceName0first and return the undefined value, then break later in the code. Now it says it's a local job, which seems better?I leave it up to OSG to decide if they want CHTC to be counted.