Bug 773702

Summary: dead recipes routine processes the same recipe mutliple times
Product: [Retired] Beaker Reporter: Bill Peck <bpeck>
Component: schedulerAssignee: Bill Peck <bpeck>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.8CC: bpeck, dcallagh, mcsontos, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-26 07:16:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bill Peck 2012-01-12 16:37:01 UTC
Description of problem:
dead recipes routine is processing the same recipe over and over.  Something is wrong with the query.

Version-Release number of selected component (if applicable):
0.8.0


Additional info:

2012-01-12 11:34:21,070 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:21,309 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:21,563 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:21,838 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:22,169 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:22,436 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:22,709 beakerd INFO R:378134 does not have a valid distro, aborting.
2012-01-12 11:34:22,979 beakerd INFO R:378134 does not have a valid distro, aborting.


def dead_recipes(*args):
    recipes = Recipe.query\
                    .join('status')\
                    .outerjoin(['systems'])\
                    .outerjoin(['distro',
                                'lab_controller_assocs',
                                'lab_controller'])\
                    .filter(
                         or_(
                         and_(Recipe.status==TaskStatus.by_name(u'Queued'),
                              System.id==None,
                             ),
                         and_(Recipe.status==TaskStatus.by_name(u'Queued'),
                              LabController.id==None,
                             ),
                            )
                           )

    if not recipes.count():
        return False
    log.debug("Entering dead_recipes routine")
    for recipe_id, in recipes.values(Recipe.id):

Comment 1 Bill Peck 2012-03-28 17:20:59 UTC
fix pushed to gerrit for review