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

[HTCondor-users] Using owner as a constraint



Hi,

ÂI'm working on a python program to find any jobs in a weird state. Long story irrelevant to the question. The point is my question is related to querying Schedd from python not running condor_q from the command line. But easier to demo there

The program will run on an AP with lots of users but I want to constrain the query to the current user.

An unconstrained query:

$ condor_q


-- Schedd: george.home.areeda.com : <127.0.0.1:9618?... @ 06/17/23 10:35:26
OWNERÂ BATCH_NAMEÂÂÂ SUBMITTEDÂÂ DONEÂÂ RUNÂÂÂ IDLEÂ TOTAL JOB_IDS
areeda ID: 239ÂÂÂÂÂ 6/17 09:38ÂÂÂÂÂ _ÂÂÂÂÂ 1ÂÂÂÂÂ _ÂÂÂÂÂ 1 239.0
areeda ID: 240ÂÂÂÂÂ 6/17 10:15ÂÂÂÂÂ _ÂÂÂÂÂ 1ÂÂÂÂÂ _ÂÂÂÂÂ 1 240.0

Total for query: 2 jobs; 0 completed, 0 removed, 0 idle, 2 running, 0 held, 0 suspended
Total for areeda: 2 jobs; 0 completed, 0 removed, 0 idle, 2 running, 0 held, 0 suspended

Constrained with comparison. What am I missing?

$ condor_q -constraint owner=="areeda"


-- Schedd: george.home.areeda.com : <127.0.0.1:9618?... @ 06/17/23 10:36:03
OWNER BATCH_NAMEÂÂÂÂÂ SUBMITTEDÂÂ DONEÂÂ RUNÂÂÂ IDLEÂÂ HOLDÂ TOTAL JOB_IDS

Total for query: 0 jobs; 0 completed, 0 removed, 0 idle, 0 running, 0 held, 0 suspended
Total for areeda: 2 jobs; 0 completed, 0 removed, 0 idle, 2 running, 0 held, 0 suspended

Constrained using regexp:

$ cq -constraint 'regexp("areeda",Owner)'


-- Schedd: george.home.areeda.com : <127.0.0.1:9618?... @ 06/17/23 10:34:59
OWNERÂ BATCH_NAMEÂÂÂ SUBMITTEDÂÂ DONEÂÂ RUNÂÂÂ IDLEÂ TOTAL JOB_IDS
areeda ID: 239ÂÂÂÂÂ 6/17 09:38ÂÂÂÂÂ _ÂÂÂÂÂ 1ÂÂÂÂÂ _ÂÂÂÂÂ 1 239.0
areeda ID: 240ÂÂÂÂÂ 6/17 10:15ÂÂÂÂÂ _ÂÂÂÂÂ 1ÂÂÂÂÂ _ÂÂÂÂÂ 1 240.0

Total for query: 2 jobs; 0 completed, 0 removed, 0 idle, 2 running, 0 held, 0 suspended
Total for areeda: 2 jobs; 0 completed, 0 removed, 0 idle, 2 running, 0 held, 0 suspended

Can you see what I'm doing wrong with the string comparison? I don't have a problem using regexp but I would like to understand what's happening.

The first thing that comes to mind is that there may be other unprintable characters in the Owner classad but a schedd.query returns:


ÂÂÂ [
ÂÂÂÂÂÂÂ JobStartDate = 1687022155;
ÂÂÂÂÂÂÂ ClusterId = 240;
ÂÂÂÂÂÂÂ JobStatus = 2;
ÂÂÂÂÂÂÂ Owner = "areeda"
ÂÂÂ ]

I have suspected that my Mac has achieved sentience and then decided she hates me.

Thanks,
Joe