build/resize retry behavior not consistent

Bug #1343858 reported by hougangliu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

nova/schedule/utils.py:

Case1: when CONF.scheduler_max_attempts >1, if the request contained an exception from a previous compute build/resize operation, the exception message would be logged in conductor.log
Case2:when CONF.scheduler_max_attempts ==1, if the request contained an exception from a previous compute build/resize operation, the exception message would not be logged in conductor.log

I think this two case should keep consistent behavior even this may not cause something wrong, just for Strict code

def populate_retry(filter_properties, instance_uuid):
    max_attempts = _max_attempts()
    force_hosts = filter_properties.get('force_hosts', [])
    force_nodes = filter_properties.get('force_nodes', [])

    if max_attempts == 1 or force_hosts or force_nodes:
        # re-scheduling is disabled.
        return

    # retry is enabled, update attempt count:
    retry = filter_properties.setdefault(
        'retry', {
            'num_attempts': 0,
            'hosts': [] # list of compute hosts tried
    })
    retry['num_attempts'] += 1

    _log_compute_error(instance_uuid, retry) <<< would not run here when max_attempts == 1

    if retry['num_attempts'] > max_attempts:
        exc = retry.pop('exc', None)
        msg = (_('Exceeded max scheduling attempts %(max_attempts)d '
                 'for instance %(instance_uuid)s. '
                 'Last exception: %(exc)s.')
               % {'max_attempts': max_attempts,
                  'instance_uuid': instance_uuid,
                  'exc': exc})
        raise exception.NoValidHost(reason=msg)

Tags: nova
hougangliu (liuhoug)
tags: added: nova
Tiago Mello (timello)
Changed in nova:
assignee: nobody → Tiago Rodrigues de Mello (timello)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/109305

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by timello (<email address hidden>) on branch: master
Review: https://review.openstack.org/109305

Tiago Mello (timello)
Changed in nova:
assignee: Tiago Rodrigues de Mello (timello) → nobody
Sean Dague (sdague)
Changed in nova:
status: In Progress → Opinion
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.