Bug 799838 - Jobs in IDLE or RUNNING state aren't visible via aviary API after HISTORY_INTERVAL period.
Jobs in IDLE or RUNNING state aren't visible via aviary API after HISTORY_INT...
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor-aviary (Show other bugs)
2.1
All Linux
medium Severity medium
: 2.2
: ---
Assigned To: Pete MacKinnon
Daniel Horák
:
Depends On:
Blocks: 828434 832968
  Show dependency treegraph
 
Reported: 2012-03-05 03:16 EST by Daniel Horák
Modified: 2012-10-30 09:25 EDT (History)
5 users (show)

See Also:
Fixed In Version: condor-7.6.5-0.16
Doc Type: Bug Fix
Doc Text:
Cause: Jobs submitted through Aviary or QMF interface. Consequence: The active jobs and their submissions are not reported by the Aviary or QMF query interface. Historic (e.g., completed) are however. Fix: Code changes to make sure that history index files were correctly cleaned up led to a situation where the internal job and submission collections were aggressively purged of active jobs. This code was corrected. Result: Jobs and submissions for active jobs appear as expected even while history indices are culled.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-19 13:42:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Helpful script for testing this bz. (1.56 KB, text/x-python)
2012-06-29 08:18 EDT, Daniel Horák
no flags Details

  None (edit)
Description Daniel Horák 2012-03-05 03:16:54 EST
Description of problem:
  Jobs are visible via aviary API only for a moment (after submit), then disappear until each of them is completed.
  (The "moment" is probably defined as HISTORY_INTERVAL.)

Version-Release number of selected component (if applicable):
  On booth platforms i386 and x86_64 on RHEL 5.8 and RHEL 6.2:
  # rpm -qa | grep condor
    condor-classads-7.6.5-0.12.el5.i386
    condor-aviary-7.6.5-0.12.el5.i386
    condor-7.6.5-0.12.el5.i386


How reproducible:
  100%


Steps to Reproduce:
1. Install "MRG Grid" and condor-aviary
  # yum install @mrg-grid condor-aviary

2. Configure HISTORY_INTERVAL in condor to short time.
  # cat /etc/condor/config.d/99_test.config 
    HISTORY_INTERVAL = 30
  # service condor restart

3. Submit few simple jobs.
  # cat /tmp/simple.job 
    universe = vanilla
    cmd = /bin/sleep
    args = 300
    output = /tmp/simple_job.$(cluster).$(process).out
    error = /tmp/simple_job.$(cluster).$(process).err
    Log = /tmp/simple_job.$(cluster).$(process).log
    requirements = (FileSystemDomain =!= UNDEFINED && Arch =!= UNDEFINED)
    queue 1
  
  # runuser -s /bin/bash -l condor -c "condor_submit /tmp/simple.job"
  # runuser -s /bin/bash -l condor -c "condor_submit /tmp/simple.job"
  # runuser -s /bin/bash -l condor -c "condor_submit /tmp/simple.job"

4. Periodically check output from aviary and compare it with output from condor_q. (eg.:)
  # date "+[%H:%M:%S]"
  # PYTHONPATH=":/usr/share/condor/aviary/module" python /usr/share/condor/aviary/jobquery.py --cmd=getJobStatus 
  # condor_q


Actual results:
  # date "+[%H:%M:%S]"
    [08:35:34]
  # PYTHONPATH=":/usr/share/condor/aviary/module" python /usr/share/condor/aviary/jobquery.py --cmd=getJobStatus 
    invoking http://localhost:9091/services/query/getJobStatus for job None
    [(JobStatus){
       id = 
          (JobID){
             job = "1.0"
             pool = "dhcp-lab-182.englab.brq.redhat.com"
             scheduler = "dhcp-lab-182.englab.brq.redhat.com"
          }
       status = 
          (Status){
             code = "OK"
          }
       job_status = "RUNNING"
     }, (JobStatus){
       id = 
          (JobID){
             job = "2.0"
             pool = "dhcp-lab-182.englab.brq.redhat.com"
             scheduler = "dhcp-lab-182.englab.brq.redhat.com"
          }
       status = 
          (Status){
             code = "OK"
          }
       job_status = "IDLE"
     }, (JobStatus){
       id = 
          (JobID){
             job = "3.0"
             pool = "dhcp-lab-182.englab.brq.redhat.com"
             scheduler = "dhcp-lab-182.englab.brq.redhat.com"
          }
       status = 
          (Status){
             code = "OK"
          }
       job_status = "IDLE"
     }]
  
  # condor_q
    -- Submitter: dhcp-lab-182.englab.brq.redhat.com : <10.34.33.182:51756> : dhcp-lab-182.englab.brq.redhat.com
     ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD               
       1.0   condor          3/5  08:35   0+00:00:16 R  0   0.0  sleep 300         
       2.0   condor          3/5  08:35   0+00:00:00 I  0   0.0  sleep 300         
       3.0   condor          3/5  08:35   0+00:00:00 I  0   0.0  sleep 300         
  
    3 jobs; 0 completed, 0 removed, 2 idle, 1 running, 0 held, 0 suspended
  
  # date "+[%H:%M:%S]"
    [08:36:13]
  
  # PYTHONPATH=":/usr/share/condor/aviary/module" python /usr/share/condor/aviary/jobquery.py --cmd=getJobStatus 
    invoking http://localhost:9091/services/query/getJobStatus for job None
    []
  
  # condor_q
    -- Submitter: dhcp-lab-182.englab.brq.redhat.com : <10.34.33.182:51756> : dhcp-lab-182.englab.brq.redhat.com
     ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD               
       1.0   condor          3/5  08:35   0+00:00:53 R  0   0.0  sleep 300         
       2.0   condor          3/5  08:35   0+00:00:00 I  0   0.0  sleep 300         
       3.0   condor          3/5  08:35   0+00:00:00 I  0   0.0  sleep 300         
  
    3 jobs; 0 completed, 0 removed, 2 idle, 1 running, 0 held, 0 suspended
  
  # date "+[%H:%M:%S]"
    [08:36:24]
  
Finished jobs are again accessible via Aviary:
  # date "+[%H:%M:%S]"
    [08:41:39]
  
  # PYTHONPATH=":/usr/share/condor/aviary/module" python /usr/share/condor/aviary/jobquery.py --cmd=getJobStatus 
    invoking http://localhost:9091/services/query/getJobStatus for job None
    [(JobStatus){
       id = 
          (JobID){
             job = "1.0"
             pool = "dhcp-lab-182.englab.brq.redhat.com"
             scheduler = "dhcp-lab-182.englab.brq.redhat.com"
          }
       status = 
          (Status){
             code = "OK"
          }
       job_status = "COMPLETED"
     }]

  # condor_q
    -- Submitter: dhcp-lab-182.englab.brq.redhat.com : <10.34.33.182:51756> : dhcp-lab-182.englab.brq.redhat.com
     ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD               
       2.0   condor          3/5  08:35   0+00:01:32 R  0   0.0  sleep 300         
       3.0   condor          3/5  08:35   0+00:00:00 I  0   0.0  sleep 300         
    
    2 jobs; 0 completed, 0 removed, 1 idle, 1 running, 0 held, 0 suspended
  
  # condor_history 
     ID      OWNER            SUBMITTED     RUN_TIME ST   COMPLETED CMD            
       1.0   condor          3/5  08:35   0+00:05:00 C   3/5  08:40 /bin/sleep 300 
  

Expected results:
  Jobs are visible via Aviary API through whole job cycle.


Additional info:
Comment 1 Pete MacKinnon 2012-04-30 15:37:05 EDT
Modifications for bug 699737 for cleaning up dangling history index files left the internal reset flags "stuck" on. Therefore internal job collections were continually being torn down and rebuilt, essentially throwing away the live jobs. History jobs were persisted and of course stable.
Comment 2 Pete MacKinnon 2012-05-04 16:23:32 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: Jobs submitted through Aviary or QMF interface.
Consequence: The active jobs and their submissions are not reported by the Aviary or QMF query interface. Historic (e.g., completed) are however.
Fix: Code changes to make sure that history index files were correctly cleaned up led to a situation where the internal job and submission collections were aggressively purged of active jobs. This code was corrected.
Result: Jobs and submissions for active jobs appear as expected even while history indices are culled.
Comment 5 Daniel Horák 2012-06-29 08:18:40 EDT
Created attachment 595289 [details]
Helpful script for testing this bz.

This script print each (10) seconds list of jobs from AVIARY (with status)
and output of condor_q and condor_history commands.
Comment 6 Daniel Horák 2012-06-29 09:36:12 EDT
Tested on RHEL 5.8 and 6.3 - i386, x86_64 with:
# rpm -qa | grep condor
  condor-classads-7.6.5-0.16.el6.i686
  condor-aviary-7.6.5-0.16.el6.i686
  condor-7.6.5-0.16.el6.i686

All jobs are correctly visible via aviary with proper state through whole job live time.

>>> VERIFIED
Comment 8 errata-xmlrpc 2012-09-19 13:42:55 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1278.html

Note You need to log in before you can comment on or make changes to this bug.