)]}'
{"octavia/controller/housekeeping/house_keeping.py":[{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"a5ec1c0c150b5651a257a00beab99fdb62c41234","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                LOG.debug(\"Starting amphorae number %d ...\", i)"},{"line_number":57,"context_line":"                self.cw.create_amphora()"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # When the current spare amphora is more than required"},{"line_number":60,"context_line":"        elif diff_count \u003c 0:"},{"line_number":61,"context_line":"            LOG.info(_LI(\"Initiating deletion of %d extra spare amphorae.\") %"},{"line_number":62,"context_line":"                     abs(diff_count))"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_562b3894","line":59,"range":{"start_line":59,"start_character":33,"end_line":59,"end_character":40},"updated":"2016-09-01 09:09:01.000000000","message":"amphorae count","commit_id":"6fb226768eb7e3ee179702d1db7f3ccaeb0a7c07"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"a5ec1c0c150b5651a257a00beab99fdb62c41234","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        elif diff_count \u003c 0:"},{"line_number":61,"context_line":"            LOG.info(_LI(\"Initiating deletion of %d extra spare amphorae.\") %"},{"line_number":62,"context_line":"                     abs(diff_count))"},{"line_number":63,"context_line":"            amphora \u003d self.amp_repo.get_all(session,"},{"line_number":64,"context_line":"                                            status\u003dconstants.AMPHORA_READY)"},{"line_number":65,"context_line":"            count \u003d 0"},{"line_number":66,"context_line":"            for amp in amphora:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_79ff4f01","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":19},"updated":"2016-09-01 09:09:01.000000000","message":"nit: amphorae","commit_id":"6fb226768eb7e3ee179702d1db7f3ccaeb0a7c07"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"a5ec1c0c150b5651a257a00beab99fdb62c41234","unresolved":false,"context_lines":[{"line_number":63,"context_line":"            amphora \u003d self.amp_repo.get_all(session,"},{"line_number":64,"context_line":"                                            status\u003dconstants.AMPHORA_READY)"},{"line_number":65,"context_line":"            count \u003d 0"},{"line_number":66,"context_line":"            for amp in amphora:"},{"line_number":67,"context_line":"                LOG.debug(\"Deleting amphora with id %s ...\", amp.id)"},{"line_number":68,"context_line":"                self.cw.delete_amphora(amp.id)"},{"line_number":69,"context_line":"                count \u003d count + 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_193d63bb","line":66,"range":{"start_line":66,"start_character":23,"end_line":66,"end_character":30},"updated":"2016-09-01 09:09:01.000000000","message":"ditto","commit_id":"6fb226768eb7e3ee179702d1db7f3ccaeb0a7c07"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"7e929240715366531c75fc9ea566f1aa5f554a12","unresolved":false,"context_lines":[{"line_number":63,"context_line":"            amphora \u003d self.amp_repo.get_all(session,"},{"line_number":64,"context_line":"                                            status\u003dconstants.AMPHORA_READY)"},{"line_number":65,"context_line":"            count \u003d 0"},{"line_number":66,"context_line":"            for amp in amphora:"},{"line_number":67,"context_line":"                LOG.debug(\"Deleting amphora with id %s ...\", amp.id)"},{"line_number":68,"context_line":"                self.cw.delete_amphora(amp.id)"},{"line_number":69,"context_line":"                count \u003d count + 1"},{"line_number":70,"context_line":"                if count \u003d\u003d abs(diff_count):"},{"line_number":71,"context_line":"                    break"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        else:"},{"line_number":74,"context_line":"            LOG.debug(_LI(\"Current spare amphora count satisfies the \""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_199c865c","line":71,"range":{"start_line":66,"start_character":12,"end_line":71,"end_character":25},"updated":"2016-09-01 08:31:07.000000000","message":"Since deleting an amphora is a process that takes a non-insignificant amount of time, I think that each time we actually exceed the spares pool count, we should only delete one excess amphora. After all, if we just blindly delete a bunch in a for loop, one or more of the amphorae in the spares pool might get allocated. Which means a blind for loop here will reduce the spares count below the level we\u0027d like.\n\nEven worse, the way this is coded right now you could delete an amphora that had just been allocated.\n\nFurther, if someone is running multiple controllers, all of them could trigger near the same time, and as they busily work through a for loop they could greatly reduce the spare amphora count well below the target where we\u0027d like to be.\n\nThis loop iterates quickly enough that even if we somehow exceed the spares count by a dozen or more, it won\u0027t be long until we\u0027ve reduced the number of spares down to the threshold we want.","commit_id":"6fb226768eb7e3ee179702d1db7f3ccaeb0a7c07"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"a5ec1c0c150b5651a257a00beab99fdb62c41234","unresolved":false,"context_lines":[{"line_number":63,"context_line":"            amphora \u003d self.amp_repo.get_all(session,"},{"line_number":64,"context_line":"                                            status\u003dconstants.AMPHORA_READY)"},{"line_number":65,"context_line":"            count \u003d 0"},{"line_number":66,"context_line":"            for amp in amphora:"},{"line_number":67,"context_line":"                LOG.debug(\"Deleting amphora with id %s ...\", amp.id)"},{"line_number":68,"context_line":"                self.cw.delete_amphora(amp.id)"},{"line_number":69,"context_line":"                count \u003d count + 1"},{"line_number":70,"context_line":"                if count \u003d\u003d abs(diff_count):"},{"line_number":71,"context_line":"                    break"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        else:"},{"line_number":74,"context_line":"            LOG.debug(_LI(\"Current spare amphora count satisfies the \""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_196e4396","line":71,"range":{"start_line":66,"start_character":12,"end_line":71,"end_character":25},"in_reply_to":"fa7ab95a_199c865c","updated":"2016-09-01 09:09:01.000000000","message":"Should we also handle the case when an amphora is deleted concurrently?","commit_id":"6fb226768eb7e3ee179702d1db7f3ccaeb0a7c07"}]}
