On 5/15/2019 4:13 AM, li.canwei2@zte.com.cn wrote:
[licanwei]:please refer to <https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L144>https://github.com/openstack/watcher/blob/master/watcher/decision_engine/model/notification/nova.py#L144
When a nova notification is received before the nova CDM is built or no node in the CDM,
the node will be add to the CDM.
That's not what's happening in this bug. We're getting an instance.update event from nova during scheduling/building of an instance before it has a host, so when this is called: https://github.com/openstack/watcher/blob/master/watcher/decision_engine/mod... node_uuid is None. Which means we never call get_or_create_node here: https://github.com/openstack/watcher/blob/master/watcher/decision_engine/mod... And then we blow up here: https://github.com/openstack/watcher/blob/master/watcher/decision_engine/mod... because self.cluster_data_model is None. Based on your earlier reply about when the nova CDM is built:
[licanwei]:Yes, the CDM will be built when the first audit being created.
It seems the fix for this notification traceback bug is to just make sure the self.cluster_data_model is not None and return early if it's not, i.e. gracefully handle receiving notifications before we've ever done an audit and built the nova CDM. [licanwei]: In this case, I think we can just ignore the exception. -- Thanks, Matt