Public bug reported: This is just found by review.
The host_manager sync aggregate to host_state obj as below: host_state.aggregates = [self.aggs_by_id[agg_id] for agg_id in self.host_aggregates_map[ host_state.host]] It iterate the set directly. But at the same time, the aggregtes set can be updated concurrently. But when you change the size of set when iteration will trigger Runtime error: In [2]: s = set([1,2,3,4]) In [3]: s Out[3]: {1, 2, 3, 4} In [4]: for i in s: ...: print i ...: if i == 3: ...: s.add(5) ...: 1 2 3 --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-4-c7399e78b688> in <module>() ----> 1 for i in s: 2 print i 3 if i == 3: 4 s.add(5) 5 RuntimeError: Set changed size during iteration ** Affects: nova Importance: Undecided Assignee: Alex Xu (xuhj) Status: In Progress ** Changed in: nova Assignee: (unassigned) => Alex Xu (xuhj) -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1429492 Title: When host_manager sync the aggregates into host_state obj by iterate aggregates set in host_aggregates_map may trigger Runtime error Status in OpenStack Compute (Nova): In Progress Bug description: This is just found by review. The host_manager sync aggregate to host_state obj as below: host_state.aggregates = [self.aggs_by_id[agg_id] for agg_id in self.host_aggregates_map[ host_state.host]] It iterate the set directly. But at the same time, the aggregtes set can be updated concurrently. But when you change the size of set when iteration will trigger Runtime error: In [2]: s = set([1,2,3,4]) In [3]: s Out[3]: {1, 2, 3, 4} In [4]: for i in s: ...: print i ...: if i == 3: ...: s.add(5) ...: 1 2 3 --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-4-c7399e78b688> in <module>() ----> 1 for i in s: 2 print i 3 if i == 3: 4 s.add(5) 5 RuntimeError: Set changed size during iteration To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1429492/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp