[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[HTCondor-users] Python bindings: How do you reject a job during negotiation?



Hi,

I'm trying to use the Python bindings to negotiate with the default Schedd, and am running into an issue when there are no matches for a resource request. When iterating over the context manager object returned by Schedd.negotiate() it returns the same job/request indefinitely until sent a claim for that request. Is there a way to send a rejection for that request instead and still move on to the next one?

Example of my problem (using HTCondor v8.6.5):

user = <string for my username>
with htcondor.Schedd().negotiate(user) as session:
 ÂÂfor resource_request in session:
    print resource_request['ClusterId']

Instead of printing the cluster ID for each of my idle jobs on this Schedd, this will print the first available cluster ID in an infinite loop. I can force it to move on by sending a non-existent claim to the Schedd, but that seems wrong. i.e. Adding this line after the print statement makes it print each job once without actually matching anything:

    session.sendClaim("", classad.ClassAd(), classad.ClassAd())

Ideally what I'd like to do in this situation is something like session.sendRejection(request_ad, reason=""), but that's more of a feature request. I'm just looking to silently move on to the next request for now.

Matching actual claims works great. I only run into this when there are no matches for a request and I want to continue considering other requests.

It feels like I'm missing something obvious here. Any help is appreciated.

Thanks,
Collin