Skip to content

Handle undefined resource names#194

Merged
matyasselmeci merged 1 commit intoopensciencegrid:2.xfrom
WIPACrepo:fix-undefined-resource-name
Feb 5, 2026
Merged

Handle undefined resource names#194
matyasselmeci merged 1 commit intoopensciencegrid:2.xfrom
WIPACrepo:fix-undefined-resource-name

Conversation

@dsschult
Copy link
Contributor

@dsschult dsschult commented Jan 26, 2026

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:

LastRemoteHost = "slot1_30@e2588.chtc.wisc.edu"
LastRemotePool = "cm.chtc.wisc.edu"
MATCH_EXP_JOBGLIDEIN_ResourceName = "Local Job"
MachineAttrGLIDEIN_ResourceName0 = undefined

Before this PR, it would look at MachineAttrGLIDEIN_ResourceName0 first 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.

@brianhlin brianhlin requested a review from mwestphall January 26, 2026 21:26
Copy link
Contributor

@mwestphall mwestphall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resource_name = classad.get(attr)
resource_name = classad.eval(attr)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the HTCondor dev team, you need to use identity comparisons to check against classadLib.Value values since they're just integers

Copy link
Contributor

@mwestphall mwestphall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a couple changes

@matyasselmeci matyasselmeci merged commit 9b70a94 into opensciencegrid:2.x Feb 5, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants