Browse Source

Add note about reschedules and num_attempts in filter_properties

The "retry" entry in filter_properties is not set if reschedules
are disabled, which happens in these cases:

1. [scheduler]/max_attempts=1
2. The server is forced to a specific host and/or node.

More times than I'd like to admit, I've had to re-learn that
filter_properties['retry']['num_attempts'] will always be >1 in
conductor build_instances during a reschedule because if
reschedules are disabled, the compute service aborts the build
on failure and we don't even get back to conductor.

This change adds a note since it's hard to keep in your head how
the retry logic is all tied together from the API, superconductor,
compute and cell conductor during a reschedule scenario.

Change-Id: I83536b179000f41f9618a4b6f2a16b4440fd61ba
Related-Bug: #1781286
tags/18.0.0.0rc1
Matt Riedemann 1 year ago
parent
commit
276130c6d1
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      nova/conductor/manager.py

+ 7
- 0
nova/conductor/manager.py View File

@@ -582,6 +582,13 @@ class ComputeTaskManager(base.Base):
582 582
                 host_lists = self._schedule_instances(context, spec_obj,
583 583
                         instance_uuids, return_alternates=True)
584 584
         except Exception as exc:
585
+            # NOTE(mriedem): If we're rescheduling from a failed build on a
586
+            # compute, "retry" will be set and num_attempts will be >1 because
587
+            # populate_retry above will increment it. If the server build was
588
+            # forced onto a host/node or [scheduler]/max_attempts=1, "retry"
589
+            # won't be in filter_properties and we won't get here because
590
+            # nova-compute will just abort the build since reschedules are
591
+            # disabled in those cases.
585 592
             num_attempts = filter_properties.get(
586 593
                 'retry', {}).get('num_attempts', 1)
587 594
             updates = {'vm_state': vm_states.ERROR, 'task_state': None}

Loading…
Cancel
Save