)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ddf5f606f35566ef71552431cd78c3f80787090","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"That fix only solves part of the problem, however. There are a couple"},{"line_number":14,"context_line":"of issues remaining:"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"1) It\u0027s possible to hit a similar race condition for server groups with"},{"line_number":17,"context_line":"the \"affinity\" policy. Suppose we create a new group and then create two"},{"line_number":18,"context_line":"instances simultaneously. The scheduler sees an empty group for each,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a80dd14_efb1b5e0","line":15,"updated":"2015-03-16 07:20:31.000000000","message":"If possible it would be better to have the two fixes in separate fixes.","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"08bdd693959125b055efd5b4126f117c1fd3f016","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"That fix only solves part of the problem, however. There are a couple"},{"line_number":14,"context_line":"of issues remaining:"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"1) It\u0027s possible to hit a similar race condition for server groups with"},{"line_number":17,"context_line":"the \"affinity\" policy. Suppose we create a new group and then create two"},{"line_number":18,"context_line":"instances simultaneously. The scheduler sees an empty group for each,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a80dd14_07742034","line":15,"in_reply_to":"9a80dd14_efb1b5e0","updated":"2015-03-16 15:13:37.000000000","message":"Sure, I can do that.","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"72386d1db3697223c6e0a203d7800237438a1c56","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Validate server group affinity policy"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In git commit a79ecbe Russel Bryant submitted a partial fix for a race"},{"line_number":10,"context_line":"condition when booting an instance as part of a server group with an"},{"line_number":11,"context_line":"\"anti-affinity\" scheduler policy."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"dac4157f_d255a1c6","line":9,"updated":"2015-04-20 18:18:11.000000000","message":"s/Russel/Russell/ :)","commit_id":"9bdbd8559d39836fab652a0a6fa97e85fafabe58"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"72386d1db3697223c6e0a203d7800237438a1c56","unresolved":false,"context_lines":[{"line_number":15,"context_line":"instances simultaneously. The scheduler sees an empty group for each,"},{"line_number":16,"context_line":"assigns them to different compute nodes, and the policy is violated."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"To guard against this, we extends _validate_instance_group_policy()"},{"line_number":19,"context_line":"to cover the \"affinity\" case as well as \"anti-affinity\"."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partial-Bug: #1423648"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"dac4157f_12731982","line":18,"updated":"2015-04-20 18:18:11.000000000","message":"s/extends/extend/","commit_id":"9bdbd8559d39836fab652a0a6fa97e85fafabe58"}],"nova/compute/manager.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ddf5f606f35566ef71552431cd78c3f80787090","unresolved":false,"context_lines":[{"line_number":1426,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1427,"context_line":"                            reason\u003dmsg)"},{"line_number":1428,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1429,"context_line":"                group_hosts \u003d group.get_older_member_hosts(instance.uuid)"},{"line_number":1430,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1431,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1432,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_2fd82dee","line":1429,"updated":"2015-03-16 07:20:31.000000000","message":"it is not clear why we need to get the older members. Why would members not suffice here?\n\nI feel that the real problem is with the scheduler. Having to resort to the compute node to double check the scheduler is problematic. That is the root cause of the problem.","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"08bdd693959125b055efd5b4126f117c1fd3f016","unresolved":false,"context_lines":[{"line_number":1426,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1427,"context_line":"                            reason\u003dmsg)"},{"line_number":1428,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1429,"context_line":"                group_hosts \u003d group.get_older_member_hosts(instance.uuid)"},{"line_number":1430,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1431,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1432,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_d67397e4","line":1429,"in_reply_to":"9a80dd14_2fd82dee","updated":"2015-03-16 15:13:37.000000000","message":"See my other comment for an explanation of why we can\u0027t look at all the members.\n\nAgreed, the ideal solution would be to fix the race in the first place but that would be a major restructuring.  (It would require storing the selected host for the instace in the database much earlier so that the scheduler could use that information when scheduling other instances in the same group.)\n\nThis is just extending an existing check to cover a couple more cases.","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"fc3416f1939f26b8f73d8ab1befed5abeafe1be6","unresolved":false,"context_lines":[{"line_number":1425,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1426,"context_line":"                            reason\u003dmsg)"},{"line_number":1427,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1428,"context_line":"                group_hosts \u003d group.get_older_member_hosts(instance.uuid)"},{"line_number":1429,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1430,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1431,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_0fb7d221","line":1428,"updated":"2015-03-16 15:44:38.000000000","message":"I don\u0027t get the point why you need to change the logic. Could you please be more explicit ?","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"10178b4ba020510b3949c6f0200e0b9ab4b1020e","unresolved":false,"context_lines":[{"line_number":1425,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1426,"context_line":"                            reason\u003dmsg)"},{"line_number":1427,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1428,"context_line":"                group_hosts \u003d group.get_older_member_hosts(instance.uuid)"},{"line_number":1429,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1430,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1431,"context_line":"                    raise exception.RescheduledException("}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_e5529fdc","line":1428,"in_reply_to":"9a80dd14_0fb7d221","updated":"2015-03-16 16:19:45.000000000","message":"See my comments to Gary.","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"},{"author":{"_account_id":7221,"name":"Jennifer Mulsow","email":"jmulsow@us.ibm.com","username":"jmulsow"},"change_message_id":"4f14f168d03f144b3685b3f496569d213cb2f9c1","unresolved":false,"context_lines":[{"line_number":1430,"context_line":"                    raise exception.RescheduledException("},{"line_number":1431,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1432,"context_line":"                            reason\u003dmsg)"},{"line_number":1433,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1434,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1435,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1436,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6ced46_0e9bea67","line":1433,"updated":"2015-03-24 22:18:41.000000000","message":"My comment seemed to get entered with a garbled format. Let me try that again.\n\nWhile I think having this extra affinity check in the manager is better than what we had before, and I agree it should be implemented, it still doesn\u0027t cover the following race condition.\n\n4 VMs are created into an empty affinity group simultaneously. VM1 and VM2 get scheduled to Host1, and VM3 and VM4 get scheduled to Host2. When this check is hit for the VM with the last time-stamp (let\u0027s say that is VM4), there will be 3 VM members older than it. VM1 and VM2 on Host1, and VM3 on Host2. Since VM4\u0027s host is also Host2, it will not pass the following check. \"if group_hosts and self.host not in group hosts\". So VM4 wouldn\u0027t be rescheduled, and this would result in VMs deployed to Host1 and Host2 in the same affinity group.","commit_id":"edd3aeb029d8f35e8c155337e11a2a5900683e16"},{"author":{"_account_id":7221,"name":"Jennifer Mulsow","email":"jmulsow@us.ibm.com","username":"jmulsow"},"change_message_id":"4f14f168d03f144b3685b3f496569d213cb2f9c1","unresolved":false,"context_lines":[{"line_number":1433,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1434,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1435,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1436,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1437,"context_line":"                    raise exception.RescheduledException("},{"line_number":1438,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1439,"context_line":"                            reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6ced46_8eaefa83","line":1436,"updated":"2015-03-24 22:18:41.000000000","message":"Same comment as before w/o the garbled format.\n\nWhile I think having this extra affinity check in the manager is better than what we had before, and I agree it should be implemented, it still doesn\u0027t cover the following race condition.\n\n4 VMs are created into an empty affinity group simultaneously. VM1 and VM2 get scheduled to Host1, and VM3 and VM4 get scheduled to Host2. When this check is hit for the VM with the last time-stamp (let\u0027s say that is VM4), there will be 3 VM members older than it. VM1 and VM2 on Host1, and VM3 on Host2. Since VM4\u0027s host is also Host2, it will not pass the following check.\n\n\"if group_hosts and self.host not in group hosts\".\n\nSo VM4 wouldn\u0027t be rescheduled, and this would result in VMs deployed to Host1 and Host2 in the same affinity group.","commit_id":"edd3aeb029d8f35e8c155337e11a2a5900683e16"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"a2e5ba60ca1980d4de8cf12df328bf342b60e319","unresolved":false,"context_lines":[{"line_number":1433,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1434,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1435,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1436,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1437,"context_line":"                    raise exception.RescheduledException("},{"line_number":1438,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1439,"context_line":"                            reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_15906942","line":1436,"in_reply_to":"1a6ced46_8eaefa83","updated":"2015-03-31 16:03:09.000000000","message":"I think this would be better off as a comment in https://review.openstack.org/164762 (the fix dealing with race conditions).\n\nWhat do you think of my suggestion below about using the \"host of the earliest-created member\" for the affinity case?","commit_id":"edd3aeb029d8f35e8c155337e11a2a5900683e16"},{"author":{"_account_id":7221,"name":"Jennifer Mulsow","email":"jmulsow@us.ibm.com","username":"jmulsow"},"change_message_id":"9c2081f630cf7e345a30a511bc4dc91d83a2cae3","unresolved":false,"context_lines":[{"line_number":1433,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1434,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1435,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1436,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1437,"context_line":"                    raise exception.RescheduledException("},{"line_number":1438,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1439,"context_line":"                            reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_89133d0d","line":1436,"in_reply_to":"da9b358b_15906942","updated":"2015-03-31 17:47:46.000000000","message":"My only concern with that is what if the earliest created member has since moved to a different host, causing the policy to be violated. We would now be limiting new spawns to only be allowed to the host that was the cause of the violation, thus causing the violation to be made worse. But maybe this is okay, since there isn\u0027t much we can do if the policy has been violated prior to this. If we look at the current behavior of the affinity filter in the scheduler, it would allow a VM to be placed on any host of the group for affinity, even if the policy if violated, thus potentially furthering the violation.","commit_id":"edd3aeb029d8f35e8c155337e11a2a5900683e16"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"cc997f939da5d9c33b8d04b80e5bfdcbb898cd7f","unresolved":false,"context_lines":[{"line_number":1433,"context_line":"            elif \u0027affinity\u0027 in group.policies:"},{"line_number":1434,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1435,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1436,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1437,"context_line":"                    raise exception.RescheduledException("},{"line_number":1438,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1439,"context_line":"                            reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa041b7_008f6624","line":1436,"in_reply_to":"da9b358b_89133d0d","updated":"2015-04-01 13:35:30.000000000","message":"I\u0027m sorry, but we\u0027re currently in StringFreeze so it needs to be deferred until Liberty\nhttps://wiki.openstack.org/wiki/StringFreeze","commit_id":"edd3aeb029d8f35e8c155337e11a2a5900683e16"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"72386d1db3697223c6e0a203d7800237438a1c56","unresolved":false,"context_lines":[{"line_number":1485,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1486,"context_line":"                if self.host in group_hosts:"},{"line_number":1487,"context_line":"                    msg \u003d _(\"Anti-affinity instance group policy \""},{"line_number":1488,"context_line":"                            \"was violated.\")"},{"line_number":1489,"context_line":"                    raise exception.RescheduledException("},{"line_number":1490,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1491,"context_line":"                            reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"dac4157f_72a6d5c2","line":1488,"updated":"2015-04-20 18:18:11.000000000","message":"Here and below, would be good to add the server group name or UUID to the exception message (which will be logged at an upper layer).","commit_id":"9bdbd8559d39836fab652a0a6fa97e85fafabe58"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"20f867891c886e396f63f9630acaaa7a7c0501be","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"                group_hosts \u003d group.get_hosts(exclude\u003d[instance.uuid])"},{"line_number":1494,"context_line":"                if group_hosts and self.host not in group_hosts:"},{"line_number":1495,"context_line":"                    msg \u003d _(\"Affinity instance group policy was violated.\")"},{"line_number":1496,"context_line":"                    raise exception.RescheduledException("},{"line_number":1497,"context_line":"                            instance_uuid\u003dinstance.uuid,"},{"line_number":1498,"context_line":"                            reason\u003dmsg)"},{"line_number":1499,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7aaa499b_b9d1e1cf","line":1496,"updated":"2015-04-13 16:37:47.000000000","message":"nit: you could factorize the exception at the upper level","commit_id":"9bdbd8559d39836fab652a0a6fa97e85fafabe58"}],"nova/objects/instance_group.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ddf5f606f35566ef71552431cd78c3f80787090","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                         if instance.host]))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @base.remotable"},{"line_number":192,"context_line":"    def get_older_member_hosts(self, context, instance_uuid):"},{"line_number":193,"context_line":"        \"\"\"Get a list of hosts for older non-deleted instances in the group"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_af17bda1","line":192,"updated":"2015-03-16 07:20:31.000000000","message":"Could there be edge cases when the schedule request was stuck in a message queue and the created time is actually less than the other instance?\n\nWhy would checking the list of instances for the policy not suffice?","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"08bdd693959125b055efd5b4126f117c1fd3f016","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                         if instance.host]))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @base.remotable"},{"line_number":192,"context_line":"    def get_older_member_hosts(self, context, instance_uuid):"},{"line_number":193,"context_line":"        \"\"\"Get a list of hosts for older non-deleted instances in the group"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        This method allows you to get a list of the hosts where instances in"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_969aff5f","line":192,"in_reply_to":"9a80dd14_af17bda1","updated":"2015-03-16 15:13:37.000000000","message":"I think that\u0027s actually okay.  We don\u0027t really care about the specific order, just that there is an order that everyone can agree on.  Also, I think the instance will only get added to the DB down in compute.api.API._provision_instances() where we call self.create_db_entry_for_new_instance().  Right after that is where we would call  objects.InstanceGroup.add_members() to add the instance to the group in the DB.\n\nThe reason why it\u0027s not sufficient to check all the instances in the group is the second problem listed in the commit message.\n\nIt\u0027s possible to create two instances simultaneously, have them be scheduled to conflicting hosts, both of them detect the problem in _validate_instance_group_policy() (because they see each other), both of them get sent back for rescheduling, and both of them get assigned to conflicting hosts *again*, resulting in an error. \n\nBy ignoring instances created later, we enforce an ordering.  So in the above error case the earliest-created instance will go where it was scheduled, and the later-created one will adapt to the earlier-created one.","commit_id":"396552dd73636ee7b9e1d897bf59c21f263cf830"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"fc3416f1939f26b8f73d8ab1befed5abeafe1be6","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        return list(set([instance.host for instance in instances"},{"line_number":189,"context_line":"                         if instance.host]))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @base.remotable"},{"line_number":192,"context_line":"    def get_older_member_hosts(self, context, instance_uuid):"},{"line_number":193,"context_line":"        \"\"\"Get a list of hosts for older non-deleted instances in the group"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_ef5fde0c","line":191,"updated":"2015-03-16 15:44:38.000000000","message":"I don\u0027t like adding a remotable classmethod (and bumping a new version) for something that can be done outside IMHO","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"10178b4ba020510b3949c6f0200e0b9ab4b1020e","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        return list(set([instance.host for instance in instances"},{"line_number":189,"context_line":"                         if instance.host]))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @base.remotable"},{"line_number":192,"context_line":"    def get_older_member_hosts(self, context, instance_uuid):"},{"line_number":193,"context_line":"        \"\"\"Get a list of hosts for older non-deleted instances in the group"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_a5c5078f","line":191,"in_reply_to":"9a80dd14_ef5fde0c","updated":"2015-03-16 16:19:45.000000000","message":"What do you mean by \"done outside\"?  Are you suggesting that the equivalent code run directly on the compute node instead of being remoted?\n\nIn the case where the DB is on the same node as the conductor this could mean sending a good bit more data over the network (the list of all instance objects in the group instead of just the list of host names).","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"fc3416f1939f26b8f73d8ab1befed5abeafe1be6","unresolved":false,"context_lines":[{"line_number":3923,"context_line":"        # In practice, the instance being built will have been added to the"},{"line_number":3924,"context_line":"        # group by compute.api.API._provision_instances()"},{"line_number":3925,"context_line":"        objects.InstanceGroup.add_members(self.context, group.uuid,"},{"line_number":3926,"context_line":"                                          [instance.uuid])"},{"line_number":3927,"context_line":"        self.assertRaises(exception.RescheduledException,"},{"line_number":3928,"context_line":"                          self.compute._build_instance,"},{"line_number":3929,"context_line":"                          self.context, {}, filter_properties,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_af3b26cf","line":3926,"updated":"2015-03-16 15:44:38.000000000","message":"I don\u0027t get why you\u0027re adding a NovaObject directly in the test ? \n\nwhy aren\u0027t you mocking what you want, and play with these fake objects ?","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"10178b4ba020510b3949c6f0200e0b9ab4b1020e","unresolved":false,"context_lines":[{"line_number":3923,"context_line":"        # In practice, the instance being built will have been added to the"},{"line_number":3924,"context_line":"        # group by compute.api.API._provision_instances()"},{"line_number":3925,"context_line":"        objects.InstanceGroup.add_members(self.context, group.uuid,"},{"line_number":3926,"context_line":"                                          [instance.uuid])"},{"line_number":3927,"context_line":"        self.assertRaises(exception.RescheduledException,"},{"line_number":3928,"context_line":"                          self.compute._build_instance,"},{"line_number":3929,"context_line":"                          self.context, {}, filter_properties,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_ea550c1e","line":3926,"in_reply_to":"9a80dd14_af3b26cf","updated":"2015-03-16 16:19:45.000000000","message":"It may be that I don\u0027t know what I\u0027m doing--I\u0027m pretty inexperienced with unit tests in python.\n\nI didn\u0027t write the original testcase, I\u0027m just extending it.  The existing testcase called objects.InstanceGroup.create() to add the group to the database.  It then  calls _build_instance(), which calls _validate_instance_group_policy(), which calls objects.InstanceGroup.get_hosts(), which retrieves the information from the DB.\n\nThe reason for the change is that the new objects.InstanceGroup.get_older_member_hosts() expects the current instance to be in the list of instances returned from the database while the old code didn\u0027t care since it excluded the current instance anyway.\n\nAre you suggesting that the whole testcase should be re-architected?","commit_id":"bce62542ea7a052b00603cec16fb4799ffa195a5"}]}
