)]}'
{"oslo_messaging/_drivers/impl_rabbit.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"891d55a9c406150911ddcd7e5db0456cfcf7dbaa","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def __init__(self, exchange_name, queue_name, routing_key, type, durable,"},{"line_number":252,"context_line":"                 exchange_auto_delete, queue_auto_delete, callback,"},{"line_number":253,"context_line":"                 nowait\u003dFalse, rabbit_ha_queues\u003dNone, rabbit_queue_ttl\u003d0):"},{"line_number":254,"context_line":"        \"\"\"Init the Publisher class with the exchange_name, routing_key,"},{"line_number":255,"context_line":"        type, durable auto_delete"},{"line_number":256,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_6c34124a","line":253,"updated":"2016-05-12 20:02:54.000000000","message":"This is a huge behavior change.","commit_id":"127ea8b140a48a3bfcee8e5b5edb65762d4dc740"},{"author":{"_account_id":19520,"name":"Kirill Bespalov","email":"kbespalov@mirantis.com","username":"k.bespalov"},"change_message_id":"c3e36d995acd362d201c7e850e85b850c4c79d83","unresolved":false,"context_lines":[{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def __init__(self, exchange_name, queue_name, routing_key, type, durable,"},{"line_number":252,"context_line":"                 exchange_auto_delete, queue_auto_delete, callback,"},{"line_number":253,"context_line":"                 nowait\u003dFalse, rabbit_ha_queues\u003dNone, rabbit_queue_ttl\u003d0):"},{"line_number":254,"context_line":"        \"\"\"Init the Publisher class with the exchange_name, routing_key,"},{"line_number":255,"context_line":"        type, durable auto_delete"},{"line_number":256,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_ca5fac73","line":253,"in_reply_to":"dab17558_6c34124a","updated":"2016-05-13 17:12:23.000000000","message":"It\u0027s needs to ensure that consumer has been declared on the broker.There is no performance impact. With `nowait\u003dTrue` any problem with declaration will be occur via exception in the drain_events() where is we know nothing about the consumer.","commit_id":"127ea8b140a48a3bfcee8e5b5edb65762d4dc740"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"891d55a9c406150911ddcd7e5db0456cfcf7dbaa","unresolved":false,"context_lines":[{"line_number":1010,"context_line":"                        try:"},{"line_number":1011,"context_line":"                            consumer.consume(tag\u003dtag)"},{"line_number":1012,"context_line":"                            self._new_tags.remove(tag)"},{"line_number":1013,"context_line":"                        except self.connection.channel_errors as exc:"},{"line_number":1014,"context_line":"                            # NOTE(kbespalov): the amqp recreate a channel"},{"line_number":1015,"context_line":"                            # during \u0027queue not found\u0027 exception. In this case"},{"line_number":1016,"context_line":"                            # we must reraise exception in order to redeclare"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_8c1cd614","line":1013,"updated":"2016-05-12 20:02:54.000000000","message":"Catching channel_errors doesn\u0027t look a good idea, that hides a bug somewhere else.","commit_id":"127ea8b140a48a3bfcee8e5b5edb65762d4dc740"},{"author":{"_account_id":19520,"name":"Kirill Bespalov","email":"kbespalov@mirantis.com","username":"k.bespalov"},"change_message_id":"c3e36d995acd362d201c7e850e85b850c4c79d83","unresolved":false,"context_lines":[{"line_number":1010,"context_line":"                        try:"},{"line_number":1011,"context_line":"                            consumer.consume(tag\u003dtag)"},{"line_number":1012,"context_line":"                            self._new_tags.remove(tag)"},{"line_number":1013,"context_line":"                        except self.connection.channel_errors as exc:"},{"line_number":1014,"context_line":"                            # NOTE(kbespalov): the amqp recreate a channel"},{"line_number":1015,"context_line":"                            # during \u0027queue not found\u0027 exception. In this case"},{"line_number":1016,"context_line":"                            # we must reraise exception in order to redeclare"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_ca94cce9","line":1013,"in_reply_to":"dab17558_8c1cd614","updated":"2016-05-13 17:12:23.000000000","message":"Real problem is the rabbitmq which may not create a queue due to timeout. If the rabbitmq losing a queue and connection, we have only one attempt to recreate it in on_reconnection callback. If the attempt is fails, we will be try to consume in infinity loop from missing queue without redeclaration.","commit_id":"127ea8b140a48a3bfcee8e5b5edb65762d4dc740"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"a1be3acf40ab00d71e97771ace7461111955c5ad","unresolved":false,"context_lines":[{"line_number":1010,"context_line":"                        try:"},{"line_number":1011,"context_line":"                            consumer.consume(tag\u003dtag)"},{"line_number":1012,"context_line":"                            self._new_tags.remove(tag)"},{"line_number":1013,"context_line":"                        except self.connection.channel_errors as exc:"},{"line_number":1014,"context_line":"                            # NOTE(kbespalov): the amqp recreate a channel"},{"line_number":1015,"context_line":"                            # during \u0027queue not found\u0027 exception. In this case"},{"line_number":1016,"context_line":"                            # we must reraise exception in order to redeclare"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_b9d6f5c0","line":1013,"in_reply_to":"dab17558_ca94cce9","updated":"2016-05-14 09:39:27.000000000","message":"If rabbitmq does not create a queue when we ask, we have to catch that where it\u0027s declared, not here.\n\nIf we lost the rabbit connection, we already handle that in on_reconnection. \n\nIf rabbit lost a queue this is a rabbit bug. (If we need a workaround for a rabbit bug, this have to be documented with pointer to the rabbit bug, to be able to remove the hack when rabbit fix it)","commit_id":"127ea8b140a48a3bfcee8e5b5edb65762d4dc740"},{"author":{"_account_id":19520,"name":"Kirill Bespalov","email":"kbespalov@mirantis.com","username":"k.bespalov"},"change_message_id":"0275d642de9c8a6198a3a31d831e2a68a3d3f0b2","unresolved":false,"context_lines":[{"line_number":1015,"context_line":"                            # a queue declaration and consumer declaration"},{"line_number":1016,"context_line":"                            # the queue is can disappear. In this case"},{"line_number":1017,"context_line":"                            # we must redeclare queue and try to reconsume."},{"line_number":1018,"context_line":"                            if \u0027NOT_FOUND - no queue\u0027 in six.text_type(exc):"},{"line_number":1019,"context_line":"                                consumer.declare(self)"},{"line_number":1020,"context_line":"                            raise"},{"line_number":1021,"context_line":"            poll_timeout \u003d (self._poll_timeout if timeout is None"}],"source_content_type":"text/x-python","patch_set":3,"id":"dab17558_4ea1bd45","line":1018,"range":{"start_line":1018,"start_character":28,"end_line":1018,"end_character":76},"updated":"2016-05-16 18:23:06.000000000","message":"Here is we can\u0027t use exc.code \u003d\u003d 404 to detect that queue is not exists because 404 code is used in many exceptions. For example:\n\nNotFound: Basic.consume: (404) NOT_FOUND - failed to perform operation on queue \u0027reply_c15a3d56e2d64cfc8cc1d97c6ce7aa9e\u0027 in vhost \u0027/\u0027 due to timeout","commit_id":"f0d443be4b1144303905a1cadd7ef7f96a412ea1"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"1816c856b6bd9bce0c996876cb915bb679f47d3f","unresolved":false,"context_lines":[{"line_number":1015,"context_line":"                            # a queue declaration and consumer declaration"},{"line_number":1016,"context_line":"                            # the queue is can disappear. In this case"},{"line_number":1017,"context_line":"                            # we must redeclare queue and try to reconsume."},{"line_number":1018,"context_line":"                            if \u0027NOT_FOUND - no queue\u0027 in six.text_type(exc):"},{"line_number":1019,"context_line":"                                consumer.declare(self)"},{"line_number":1020,"context_line":"                            raise"},{"line_number":1021,"context_line":"            poll_timeout \u003d (self._poll_timeout if timeout is None"}],"source_content_type":"text/x-python","patch_set":3,"id":"dab17558_0e8cbfd8","line":1018,"range":{"start_line":1018,"start_character":28,"end_line":1018,"end_character":76},"in_reply_to":"dab17558_4ea1bd45","updated":"2016-05-17 07:01:33.000000000","message":"nit: What ever the reason of the 404, perhaps we can try to redeclare it. Parsing exception as string is not good, because the message depends on which kombu lib is used and the version of rabbitmq. Obviously, I don\u0027t think rabbitmq will change this message, and the only recommended lib is py-amqp. But I prefer the code to be more generic.\n\n-1: Also as we have a workaround for the race you describe, we shouldn\u0027t raise in case of next consumer.consume() works. Deployer shouldn\u0027t see any error messages when we recover automatically.\n\nWhat do you think of adding next to the re-declaration:\n  \n   consumer.consume(tag\u003dtag)\n   self._new_tags.remove(tag)","commit_id":"f0d443be4b1144303905a1cadd7ef7f96a412ea1"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"6359e9656a220d18518ceada555ced460fe3ebdf","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"            if not self.connection.connected:"},{"line_number":1005,"context_line":"                raise self.connection.recoverable_connection_errors[0]"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"            while self._new_tags:"},{"line_number":1008,"context_line":"                for consumer, tag in self._consumers.items():"},{"line_number":1009,"context_line":"                    if tag in self._new_tags:"},{"line_number":1010,"context_line":"                        try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dab17558_61c73d45","line":1007,"updated":"2016-05-17 16:05:08.000000000","message":"We should retry more than twice in a row for this kind of race, if server goes mad and always returns 404, the application will looks stuck.","commit_id":"edd7b74adde533da844567adacb13b44eb4374db"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"50b7d15a61585d9c79e5179a56570a21af9c2a0c","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"            if not self.connection.connected:"},{"line_number":1005,"context_line":"                raise self.connection.recoverable_connection_errors[0]"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"            consume_retries \u003d self.max_retries or 10"},{"line_number":1008,"context_line":"            while self._new_tags and consume_retries \u003e 0:"},{"line_number":1009,"context_line":"                for consumer, tag in self._consumers.items():"},{"line_number":1010,"context_line":"                    if tag in self._new_tags:"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab6814e_37e4370c","line":1007,"updated":"2016-05-18 07:16:55.000000000","message":"max_retries is unrelated to this, this is a connection stuffs, and from my point of view it should be deprecated, but that an other subject. \n\nWe already have this kind of fix for other 404 race that can occurs, we decide to retry once only.","commit_id":"003044c7eb341dfdc4efcba38d4a637a68276c67"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8c6461ade00c0ab3b42eaff4a21f70b19bc32cfa","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                            # we must redeclare queue and try to re-consume."},{"line_number":1019,"context_line":"                            # More details is here:"},{"line_number":1020,"context_line":"                            # bugs.launchpad.net/oslo.messaging/+bug/1581148"},{"line_number":1021,"context_line":"                            if exc.code \u003d\u003d 404 and consume_max_retries:"},{"line_number":1022,"context_line":"                                consumer.declare(self)"},{"line_number":1023,"context_line":"                                # NOTE(kbespalov): the broker closes a channel"},{"line_number":1024,"context_line":"                                # at any channel error. The py-amqp catches"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_7062993f","line":1021,"updated":"2016-09-13 15:19:37.000000000","message":"the \"and consume_max_retries\" isn\u0027t necessary above :)","commit_id":"43cfc18fc9a307b44eebdd052203de8e44dbc814"}]}
