)]}'
{"ceilometer/publisher/rpc.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"4f73a57afe5d9854237c35332c9c3ebf7c4a0564","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":122,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":123,"context_line":"            \u0027max_queue_length\u0027, [1024])[-1])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.local_queue \u003d []"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.policy in [\u0027queue\u0027, \u0027drop\u0027]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F%2BnE%3D","line":124,"updated":"2013-08-19 12:15:32.000000000","message":"Did you try to use a threading.local() attribute rather? That could be safer.","commit_id":"29d8735debf53849341dfa6002adabf7415418fe"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"42b56dc2de95dd4217a0a223c3511a29ecec7826","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.policy \u003d options.get(\u0027policy\u0027, [\u0027wait\u0027])[-1]"},{"line_number":122,"context_line":"        self.max_queue_length \u003d int(options.get("},{"line_number":123,"context_line":"            \u0027max_queue_length\u0027, [1024])[-1])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.local_queue \u003d []"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.policy in [\u0027queue\u0027, \u0027drop\u0027]:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F%2BS0%3D","line":124,"in_reply_to":"AAAARn%2F%2F%2BnE%3D","updated":"2013-08-19 13:39:26.000000000","message":"This creates a self.local_queue per pseudo threads (If the eventlet patched version works like the original one), and the pseudo thread context is never reused, so the message in the local queue cannot be reprocessed.\n\nA other solution is to use eventlet.Queue to handle the queue but It will add a lock between each publish_samples call.\n\nThis is why I have preferred to handle to empty the queue before using rpc.cast and readded unsent messages to the queue after the rpc.cast call.\n\nIt can have a side effet if queue policy \u003d\u003d \u0027queue\u0027 and the maximum queue size is reached, the dropped samples cannot be the oldest one.\n\nI have no objection to change this to eventlet.Queue is this code look to crappy or not understandable.","commit_id":"29d8735debf53849341dfa6002adabf7415418fe"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"c2265b014168944076c34d4eb816a10a22021423","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        queue \u003d self.local_queue"},{"line_number":188,"context_line":"        self.local_queue \u003d []"},{"line_number":189,"context_line":"        remaining_queue \u003d self._process_queue(queue, self.policy)"},{"line_number":190,"context_line":"        self.local_queue.extend(remaining_queue)"},{"line_number":191,"context_line":"        if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":192,"context_line":"            self._check_queue_length()"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F3Bs%3D","line":190,"updated":"2013-08-21 02:45:31.000000000","message":"should remaining_queue extend local_queue? this seems like the \u0027new\u0027 queue items would be dropped before the items in the previous remaining_queue based on check_queue_length()","commit_id":"29d8735debf53849341dfa6002adabf7415418fe"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b05494785e85ef2bdb5d27632a8272ae0865e403","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        queue \u003d self.local_queue"},{"line_number":188,"context_line":"        self.local_queue \u003d []"},{"line_number":189,"context_line":"        remaining_queue \u003d self._process_queue(queue, self.policy)"},{"line_number":190,"context_line":"        self.local_queue.extend(remaining_queue)"},{"line_number":191,"context_line":"        if self.policy \u003d\u003d \u0027queue\u0027:"},{"line_number":192,"context_line":"            self._check_queue_length()"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F2Og%3D","line":190,"in_reply_to":"AAAARn%2F%2F3Bs%3D","updated":"2013-08-21 07:46:40.000000000","message":"Yes you have right. Done","commit_id":"29d8735debf53849341dfa6002adabf7415418fe"}]}
