)]}'
{"ceilometer/publisher/rpc.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"af782ed827337bc2b207ed281a8e910e787681db","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # behavior is implemented in oslo"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                rpc.cast(*self.local_queue[0])"},{"line_number":176,"context_line":"            except SystemExit:"},{"line_number":177,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":178,"context_line":"                    LOG.warn(\"Failed to publish counter, queue it\")"},{"line_number":179,"context_line":"                    queue_length \u003d len(self.local_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FT48%3D","line":176,"updated":"2013-07-04 10:01:49.000000000","message":"I think your patch into Oslo to change that has been merged, so I\u0027m afraid this stops working as soon as we update Oslo. What about making this just except Exception? :(","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"ea09e74975f5b280dcba40dc10c1430eaca3d0dc","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # behavior is implemented in oslo"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                rpc.cast(*self.local_queue[0])"},{"line_number":176,"context_line":"            except SystemExit:"},{"line_number":177,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":178,"context_line":"                    LOG.warn(\"Failed to publish counter, queue it\")"},{"line_number":179,"context_line":"                    queue_length \u003d len(self.local_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTpA%3D","line":176,"in_reply_to":"AAAAPn%2F%2FT48%3D","updated":"2013-07-04 12:12:52.000000000","message":"Yes, oslo.rpc use the generic exception \u0027RPCException\u0027\nSo, I will use \u0027except SystemExit, RPCException\u0027, what do you think ?","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"7943f51816094725fe82bca92d39f06671acd5ed","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # behavior is implemented in oslo"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                rpc.cast(*self.local_queue[0])"},{"line_number":176,"context_line":"            except SystemExit:"},{"line_number":177,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":178,"context_line":"                    LOG.warn(\"Failed to publish counter, queue it\")"},{"line_number":179,"context_line":"                    queue_length \u003d len(self.local_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTcc%3D","line":176,"in_reply_to":"AAAAPn%2F%2FTnM%3D","updated":"2013-07-04 13:23:09.000000000","message":"Done","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"1b50761a7145dee901fdd416a51f36178e2a1877","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # behavior is implemented in oslo"},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                rpc.cast(*self.local_queue[0])"},{"line_number":176,"context_line":"            except SystemExit:"},{"line_number":177,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":178,"context_line":"                    LOG.warn(\"Failed to publish counter, queue it\")"},{"line_number":179,"context_line":"                    queue_length \u003d len(self.local_queue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTnM%3D","line":176,"in_reply_to":"AAAAPn%2F%2FTpA%3D","updated":"2013-07-04 12:18:30.000000000","message":"Yes, I think it\u0027s safer -- we can remove the SystemExit later when we update Oslo, but at least we\u0027re sure we aren\u0027t going to break this code :)","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"af782ed827337bc2b207ed281a8e910e787681db","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FT5A%3D","line":195,"updated":"2013-07-04 10:01:49.000000000","message":"By indenting by one more level this `else\u0027 you could avoir the 2 returns above.\n#protip","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"ea09e74975f5b280dcba40dc10c1430eaca3d0dc","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FToE%3D","line":195,"in_reply_to":"AAAAPn%2F%2FT5A%3D","updated":"2013-07-04 12:12:52.000000000","message":"This is the else for the try...except...else.. construction not the if..elif.. one.\n\nIn case of the exception is not raised.","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"7943f51816094725fe82bca92d39f06671acd5ed","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTcY%3D","line":195,"in_reply_to":"AAAAPn%2F%2FTd4%3D","updated":"2013-07-04 13:23:09.000000000","message":"Done","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"86c327ddc6942ae7cd4dcaf7443809e15d35739c","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTd4%3D","line":195,"in_reply_to":"AAAAPn%2F%2FTlE%3D","updated":"2013-07-04 13:06:12.000000000","message":"Ah right, I missed that. I guess that id would be indeed clearer with break, but that\u0027s really minor :)","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"da0ce9c2b4b908625cb49da864b8a81374169aec","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTlE%3D","line":195,"in_reply_to":"AAAAPn%2F%2FTnE%3D","updated":"2013-07-04 13:02:49.000000000","message":"I must use return to break the while loop, break should works too, perhaps it is more readable with break ?","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"1b50761a7145dee901fdd416a51f36178e2a1877","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTnE%3D","line":195,"in_reply_to":"AAAAPn%2F%2FToE%3D","updated":"2013-07-04 12:18:30.000000000","message":"Ah, Python indentation! So you can already remove the return above then :)\nThough it\u0027s a detail.","commit_id":"57829b7aa75e132405c2d4c868cc3ab0501275cb"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fde344a5e04e7ef6670ed0fe02643be023eaf051","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.options \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        self.local_queue \u003d []"},{"line_number":113,"context_line":"        self.policy \u003d self.options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":114,"context_line":"        if self.policy in [\u0027queue\u0027, \u0027drop\u0027]:"},{"line_number":115,"context_line":"            LOG.info(\u0027Publishing policy set to %s, \\"},{"line_number":116,"context_line":"                     override rabbit_max_retries to 1\u0027 % self.policy)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSvI%3D","line":113,"updated":"2013-07-04 20:48:16.000000000","message":"Is this because parse_qs always returns a list for the option value? If so, I think this is \"odd\" enough to warrant a comment explaining what is going on.","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"f4eb25efc2248259068948d808d696e63435147a","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.options \u003d urlparse.parse_qs(parsed_url.query)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        self.local_queue \u003d []"},{"line_number":113,"context_line":"        self.policy \u003d self.options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":114,"context_line":"        if self.policy in [\u0027queue\u0027, \u0027drop\u0027]:"},{"line_number":115,"context_line":"            LOG.info(\u0027Publishing policy set to %s, \\"},{"line_number":116,"context_line":"                     override rabbit_max_retries to 1\u0027 % self.policy)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSK8%3D","line":113,"in_reply_to":"AAAAPn%2F%2FSvI%3D","updated":"2013-07-05 09:01:20.000000000","message":"Done","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fde344a5e04e7ef6670ed0fe02643be023eaf051","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"                elif self.policy \u003d\u003d \u0027drop\u0027:"},{"line_number":188,"context_line":"                    self.local_queue \u003d []"},{"line_number":189,"context_line":"                    LOG.warn("},{"line_number":190,"context_line":"                        \"Failed to publish counter, dropping it\")"},{"line_number":191,"context_line":"                    break"},{"line_number":192,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSu0%3D","line":189,"updated":"2013-07-04 20:48:16.000000000","message":"Should this log message at least include the name of the thing being dropped?","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"f4eb25efc2248259068948d808d696e63435147a","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"                elif self.policy \u003d\u003d \u0027drop\u0027:"},{"line_number":188,"context_line":"                    self.local_queue \u003d []"},{"line_number":189,"context_line":"                    LOG.warn("},{"line_number":190,"context_line":"                        \"Failed to publish counter, dropping it\")"},{"line_number":191,"context_line":"                    break"},{"line_number":192,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSC8%3D","line":189,"in_reply_to":"AAAAPn%2F%2FSu0%3D","updated":"2013-07-05 09:01:20.000000000","message":"In reality, there are many messages in local queue, each have many counters, so I have just added the number of counters dropped.","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fde344a5e04e7ef6670ed0fe02643be023eaf051","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    break"},{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSu4%3D","line":194,"updated":"2013-07-04 20:48:16.000000000","message":"It looks like this will be triggered when the mode is \"wait\". I would have expected \"wait\" to retry or something. What does it actually mean?","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"f4eb25efc2248259068948d808d696e63435147a","unresolved":false,"context_lines":[{"line_number":191,"context_line":"                    break"},{"line_number":192,"context_line":"                else:"},{"line_number":193,"context_line":"                    self.local_queue \u003d []"},{"line_number":194,"context_line":"                    raise"},{"line_number":195,"context_line":"            else:"},{"line_number":196,"context_line":"                self.local_queue.pop(0)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSHY%3D","line":194,"in_reply_to":"AAAAPn%2F%2FSu4%3D","updated":"2013-07-05 09:01:20.000000000","message":"I guess \u0027wait\u0027 is not a good name choice, I have changed to \"default\" and I have added some explanations because the default behavior mainly depends of the rabbitmq configuration.","commit_id":"f992029a9ed188cf97db4f802e16899b55c94e2b"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8acae31438ef84b43ab4cc8abeadabf7937d168a","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                    counters \u003d sum([len(m[\u0027args\u0027][\u0027data\u0027])"},{"line_number":206,"context_line":"                                    for _, _, m in self.local_queue])"},{"line_number":207,"context_line":"                    LOG.warn("},{"line_number":208,"context_line":"                        \"Failed to publish %d counters, dropping it\", counters)"},{"line_number":209,"context_line":"                    self.local_queue \u003d []"},{"line_number":210,"context_line":"                    break"},{"line_number":211,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2FRXE%3D","line":208,"updated":"2013-07-05 15:03:38.000000000","message":"If there are multiple counters \"it\" should be \"them\". Rather than adding logic to change that word in the message, you could just remove \"it\".","commit_id":"6b8479eba920e6b260309a068194a199454e3268"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"7d37fdd6f85b12d6dd023db349cd8cd27c520fdb","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            context, topic, msg \u003d self.local_queue[0]"},{"line_number":194,"context_line":"            try:"},{"line_number":195,"context_line":"                rpc.cast(context, topic, msg)"},{"line_number":196,"context_line":"            except SystemExit, rpc.common.RPCException:"},{"line_number":197,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":198,"context_line":"                    queue_length \u003d len(self.local_queue)"},{"line_number":199,"context_line":"                    if queue_length \u003e self.max_queue_length \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FsdE%3D","line":196,"updated":"2013-07-12 21:15:58.000000000","message":"This should be\n\n  except (SystemExit, rpc.common.RPCException):\n\nTo prevent having a SystemExit instance replace the definition of the RPCException class.","commit_id":"2f2ad824cbbe54768ab547631624e250e10f4668"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"8381e803ab34f6d4c1976ccc1a9d474fe379d942","unresolved":false,"context_lines":[{"line_number":193,"context_line":"            context, topic, msg \u003d self.local_queue[0]"},{"line_number":194,"context_line":"            try:"},{"line_number":195,"context_line":"                rpc.cast(context, topic, msg)"},{"line_number":196,"context_line":"            except SystemExit, rpc.common.RPCException:"},{"line_number":197,"context_line":"                if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":198,"context_line":"                    queue_length \u003d len(self.local_queue)"},{"line_number":199,"context_line":"                    if queue_length \u003e self.max_queue_length \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2Frqc%3D","line":196,"in_reply_to":"AAAAP3%2F%2FsdE%3D","updated":"2013-07-13 06:46:08.000000000","message":"Done","commit_id":"2f2ad824cbbe54768ab547631624e250e10f4668"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"10c7a4ce11a22137b162714f209ee38b01bb9863","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            options.get(\u0027per_meter_topic\u0027, [0])[-1]))"},{"line_number":119,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":120,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":121,"context_line":"            \u0027max_queue_length\u0027, [0])[-1])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        self.local_queue \u003d []"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgYc%3D","line":121,"updated":"2013-07-17 08:18:04.000000000","message":"Is zero (i.e. unlimited?) really the best default max_queue_length?\n\nWould a sane finite default, e.g. 1024, be better in practice?","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"569cb2b2d870255e178dffcfa8e32d36644a43c0","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            options.get(\u0027per_meter_topic\u0027, [0])[-1]))"},{"line_number":119,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":120,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":121,"context_line":"            \u0027max_queue_length\u0027, [0])[-1])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        self.local_queue \u003d []"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgG0%3D","line":121,"in_reply_to":"AAAAP3%2F%2FgMs%3D","updated":"2013-07-17 09:49:37.000000000","message":"You are right avoiding MemoryError is a better conservative choice (I don\u0027t want to see bug report with MemoryError :p) , I will update the review with 1024.","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1719917458d3141a48d4ef0008caff3badffde0e","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            options.get(\u0027per_meter_topic\u0027, [0])[-1]))"},{"line_number":119,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":120,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":121,"context_line":"            \u0027max_queue_length\u0027, [0])[-1])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        self.local_queue \u003d []"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgMs%3D","line":121,"in_reply_to":"AAAAP3%2F%2FgSk%3D","updated":"2013-07-17 09:22:28.000000000","message":"So in that case, would it make sense to just explicit configure max_queue_lenegth\u003d0?\n\nBut OK, I take the point that the default should be the more conservative choice (where conservative could mean never dropping messages deliberately, or avoiding blowing up with MemoryError).\n\nAt least by avoiding the MemoryError, the process can continue on in a controlled way when the AMQP provider layer is eventually restored (assuming an AMQP outage is the cause of the messages backing up).","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"5ef0fa9023336904b1bd9ab9c9c631dd7b434deb","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            options.get(\u0027per_meter_topic\u0027, [0])[-1]))"},{"line_number":119,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":120,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":121,"context_line":"            \u0027max_queue_length\u0027, [0])[-1])"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        self.local_queue \u003d []"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgSk%3D","line":121,"in_reply_to":"AAAAP3%2F%2FgYc%3D","updated":"2013-07-17 08:48:21.000000000","message":"I have choice zero because most of default value in ceilometer is for billing system.\n\nAnd my use case is, I don\u0027t want to block swift_middleware when amqp is down/restarted/... but I don\u0027t want to loose counters.","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"10c7a4ce11a22137b162714f209ee38b01bb9863","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                topic_name \u003d topic + \u0027.\u0027 + meter_name"},{"line_number":174,"context_line":"                LOG.audit(\u0027Publishing %d counters on %s\u0027,"},{"line_number":175,"context_line":"                          len(msg[\u0027args\u0027][\u0027data\u0027]), topic_name)"},{"line_number":176,"context_line":"                self.local_queue.append((context, topic_name, msg))"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.flush()"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgX8%3D","line":176,"updated":"2013-07-17 08:18:04.000000000","message":"Are publish_counters() calls always serialized?\n\n(just wondering about the edge case of two concurrent flush() calls draining the same local queue, ordering impact etc.)","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"80d997f36e2fcb6ecb70206655d3311b2dbdf9c8","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                topic_name \u003d topic + \u0027.\u0027 + meter_name"},{"line_number":174,"context_line":"                LOG.audit(\u0027Publishing %d counters on %s\u0027,"},{"line_number":175,"context_line":"                          len(msg[\u0027args\u0027][\u0027data\u0027]), topic_name)"},{"line_number":176,"context_line":"                self.local_queue.append((context, topic_name, msg))"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.flush()"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgOI%3D","line":176,"in_reply_to":"AAAAP3%2F%2FgUk%3D","updated":"2013-07-17 09:12:55.000000000","message":"Cool, me just being paranoid ...","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"71146b23b0cecd06613d73ae0d3c354a09490c6b","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                topic_name \u003d topic + \u0027.\u0027 + meter_name"},{"line_number":174,"context_line":"                LOG.audit(\u0027Publishing %d counters on %s\u0027,"},{"line_number":175,"context_line":"                          len(msg[\u0027args\u0027][\u0027data\u0027]), topic_name)"},{"line_number":176,"context_line":"                self.local_queue.append((context, topic_name, msg))"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        self.flush()"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgUk%3D","line":176,"in_reply_to":"AAAAP3%2F%2FgX8%3D","updated":"2013-07-17 08:34:53.000000000","message":"Yeah there\u0027s no multithreading at all.","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"10c7a4ce11a22137b162714f209ee38b01bb9863","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        #note(sileht):"},{"line_number":182,"context_line":"        # the behavior of rpc.cast call depends of rabbit_max_retries"},{"line_number":183,"context_line":"        # if rabbit_max_retries \u003c\u003d 0:"},{"line_number":184,"context_line":"        #   it return only if the msg has been sent on the amqp queue"},{"line_number":185,"context_line":"        # if rabbit_max_retries \u003e 0:"},{"line_number":186,"context_line":"        #   it raise a exception if rabbitmq is unreachable"},{"line_number":187,"context_line":"        #"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgX0%3D","line":184,"updated":"2013-07-17 08:18:04.000000000","message":"s/it return/it returns/","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"10c7a4ce11a22137b162714f209ee38b01bb9863","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        # if rabbit_max_retries \u003c\u003d 0:"},{"line_number":184,"context_line":"        #   it return only if the msg has been sent on the amqp queue"},{"line_number":185,"context_line":"        # if rabbit_max_retries \u003e 0:"},{"line_number":186,"context_line":"        #   it raise a exception if rabbitmq is unreachable"},{"line_number":187,"context_line":"        #"},{"line_number":188,"context_line":"        # Ugly, but actually the oslo.rpc do a sys.exit(1) instead of a"},{"line_number":189,"context_line":"        # RPCException, so we catch both until a correct behavior is"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgXo%3D","line":186,"updated":"2013-07-17 08:18:04.000000000","message":"s/it raise/it raises/","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"80d997f36e2fcb6ecb70206655d3311b2dbdf9c8","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                    queue_length \u003d len(self.local_queue)"},{"line_number":202,"context_line":"                    if queue_length \u003e self.max_queue_length \u003e 0:"},{"line_number":203,"context_line":"                        count \u003d queue_length - self.max_queue_length"},{"line_number":204,"context_line":"                        self.local_queue \u003d self.local_queue[count:]"},{"line_number":205,"context_line":"                    LOG.warn(\"Failed to publish counters, queue it\")"},{"line_number":206,"context_line":"                    break"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgOM%3D","line":204,"updated":"2013-07-17 09:12:55.000000000","message":"Need to also log a warning that the queue is being truncated here?\n\nAlso the way the queue truncation logic works, we allow the queue to temporarily grow beyond the configured max len. Would it be better to do the limit check on line 176 and truncate there if necessary before appending?","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"ea096c5edb9a497b58686fe32b4347edc052afae","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                    queue_length \u003d len(self.local_queue)"},{"line_number":202,"context_line":"                    if queue_length \u003e self.max_queue_length \u003e 0:"},{"line_number":203,"context_line":"                        count \u003d queue_length - self.max_queue_length"},{"line_number":204,"context_line":"                        self.local_queue \u003d self.local_queue[count:]"},{"line_number":205,"context_line":"                    LOG.warn(\"Failed to publish counters, queue it\")"},{"line_number":206,"context_line":"                    break"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2FgF0%3D","line":204,"in_reply_to":"AAAAP3%2F%2FgOM%3D","updated":"2013-07-17 09:54:07.000000000","message":"I cut the queue here because, if max_length is 100 and publish_counters caller publish more than 100 counters, I should try to send them at least one time, before drop some of them.\n\n\nI will add the log.","commit_id":"d7c81601e309fc7457d18c38466de85d0639b834"}]}
