)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-03-06 23:57:11 +0000"},{"line_number":4,"context_line":"Commit:     Gerrit Code Review \u003creview@openstack.org\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-04-22 20:03:06 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"L3 agent prefers RPC messages over full sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Combine the work from _rpc_loop and _sync_routers_task in to a single loop"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAXH%2F%2FDAk%3D","line":6,"updated":"2014-04-24 11:55:24.000000000","message":"In the bug you said something that really tied this patch in for me: When the L3 agent starts up and runs the sync task it doesn\u0027t process any incoming RPC events. I think it\u0027d be great if you could paste that into this commit message.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-03-06 23:57:11 +0000"},{"line_number":4,"context_line":"Commit:     Gerrit Code Review \u003creview@openstack.org\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-04-22 20:03:06 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"L3 agent prefers RPC messages over full sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Combine the work from _rpc_loop and _sync_routers_task in to a single loop"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAXX%2F%2F3Nk%3D","line":6,"in_reply_to":"AAAAXH%2F%2FDAk%3D","updated":"2014-04-25 17:57:41.000000000","message":"Done","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"60326ab3f57b8d61a8ad892a4a70974e45c88cbf","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-03-06 23:57:11 +0000"},{"line_number":4,"context_line":"Commit:     Carl Baldwin \u003ccarl.baldwin@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-04-25 18:23:18 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"L3 agent prefers RPC messages over full sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the L3 agent starts up and runs the sync task it doesn\u0027t process"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAXX%2F%2Fyv4%3D","line":6,"updated":"2014-04-27 10:04:08.000000000","message":"I wanted to bring my comment from patch set 8 to somewhere more visible, and hopefully explain it better:\n\nInstead of the spawning a RouterProcessor class, then putting the update in the master instance queue, I suggest a more traditional approach:\n\n- L3 agent holds an RouterUpdates class instance\n- RouterUpdates definition:\n* Init receives callbacks (How to process an event: process_routers and router_removed)\n* Dictionary from router_id to timestamp, updated whenever an event is finished processing, and used to know if an update is out of order and should be skipped\n* self._queues: N (\u003d4, for example) priority queues, each with its own worker\n* Enqueue receives update, puts it in self._queues[update.router_id % N]\n\n* Each worker spawned in eventlet thread. Gets events from its own queue (All updates for a router are guaranteed to reach a consistent queue).\nWhen it pops an event, it filters according to the timestamp, like how you do in the current patch set.\nHere, we\u0027ll check the router_id -\u003e timestamp dict which is at the EventsHandler level. The worker would find an in-order event, call the callback on it (IE: Process it), then update the last_updated dict.\n\n* Additional choices:\n    - Create a \u0027Worker\u0027 class or not (It could handle the time filtering logic for example)\npossibly hold its queue, so that RouterUpdates._queues would hold\ninstances of Workers instead of PriorityQueues and some of its logic\nwould be moved into the Worker class\n     - If the workers somehow yield updates that are processed by the L3 agent, or are callbacks passed into the RouterUpdates or Worker class and called there","commit_id":"4c74cb3a5b5c92d06d4d9c2b882c86c65c7f86cd"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"63b9ee70fa20464e99ca0b1d22d4b71b123c3a7c","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-03-06 23:57:11 +0000"},{"line_number":4,"context_line":"Commit:     Carl Baldwin \u003ccarl.baldwin@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-04-25 18:23:18 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"L3 agent prefers RPC messages over full sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When the L3 agent starts up and runs the sync task it doesn\u0027t process"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAXX%2F%2Fsws%3D","line":6,"in_reply_to":"AAAAXX%2F%2Fyv4%3D","updated":"2014-04-28 16:02:44.000000000","message":"I\u0027m going to push back on this a bit.  Hopefully, I can do it in a gracious manner.\n\nI\u0027m not sure what makes your described approach more traditional.  That is a subjective term.  Furthermore, I\u0027m not convinced that there is a clear enough advantage to your approach to justify a change in direction.\n\nCan I be sure that using modulo arithmetic or some hash will sufficiently spread out the routers among workers?  There will be scenarios where one worker is getting overworked because the wrong combination of routers is getting a lot of changes and they happen to be assigned to the same worker.\n\nA very large number of routers will statistically be spread evenly.  However, in the steady state where only a smaller number of routers are seeing changes during any given period of time, statistics is irrelevant.  My implementation guarantees fairness according to the priority.  It also allows for a more complex computation of priority in the future which could support different service levels, for example.\n\nNow that I\u0027ve completed this implementation it will take some rework and retesting to change directions.  Do you see any real problems with this implementation aside from not being \"traditional\" in your view?","commit_id":"4c74cb3a5b5c92d06d4d9c2b882c86c65c7f86cd"}],"neutron/agent/l3_agent.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"1bbd52071ba0e2bc4d4319b1dd61fa09dcf17512","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import eventlet"},{"line_number":22,"context_line":"import netaddr"},{"line_number":23,"context_line":"from oslo.config import cfg"},{"line_number":24,"context_line":"from Queue import PriorityQueue"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"from neutron.agent.common import config"},{"line_number":27,"context_line":"from neutron.agent.linux import external_process"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FqfY%3D","line":24,"updated":"2014-03-14 16:16:20.000000000","message":"Just \"import Queue\": http://docs.openstack.org/developer/hacking/#imports","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        if self._i_am_master():"},{"line_number":189,"context_line":"            while self._last_processed \u003c self._last_update:"},{"line_number":190,"context_line":"                self._last_processed \u003d timeutils.utcnow()"},{"line_number":191,"context_line":"                yield True"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def release(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTCU%3D","line":190,"updated":"2014-03-07 04:36:03.000000000","message":"I record the current time with the assumption that the processing step will fetch the details for the router from the db fresh.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":751,"context_line":"        LOG.debug(_(\u0027Got router added to agent :%r\u0027), payload)"},{"line_number":752,"context_line":"        self.routers_updated(context, payload)"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"    def _process_routers_from_queue(self, thread_num):"},{"line_number":755,"context_line":"        while True:"},{"line_number":756,"context_line":"            (low_priority, timestamp, id) \u003d self._queue.get()"},{"line_number":757,"context_line":"            msg \u003d _(\"Carl %d:  Popped \u0027%s\u0027 off of the queue.\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTDg%3D","line":754,"updated":"2014-03-07 04:36:03.000000000","message":"You can actually run this code in devstack or wherever.  It doesn\u0027t do anything but log where it would process a router.  The real processing is still done down in _process_routers.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            LOG.debug(msg, thread_num, id)"},{"line_number":759,"context_line":""},{"line_number":760,"context_line":"            with exclusive_router_access(id) as access:"},{"line_number":761,"context_line":"                for update in access.updates(timestamp):"},{"line_number":762,"context_line":"                    # TODO(Carl) Fetch router details from the database"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"                    msg \u003d _(\"Carl %d:  Processing router \u0027%s\u0027\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTCs%3D","line":761,"updated":"2014-03-07 04:36:03.000000000","message":"If an update to the router is popped off the queue by another thread while this thread is working on it then this for loop will cause this thread to repeat processing of the router to catch the update.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":759,"context_line":""},{"line_number":760,"context_line":"            with exclusive_router_access(id) as access:"},{"line_number":761,"context_line":"                for update in access.updates(timestamp):"},{"line_number":762,"context_line":"                    # TODO(Carl) Fetch router details from the database"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"                    msg \u003d _(\"Carl %d:  Processing router \u0027%s\u0027\")"},{"line_number":765,"context_line":"                    LOG.debug(msg, thread_num, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTCc%3D","line":762,"updated":"2014-03-07 04:36:03.000000000","message":"I\u0027ll fetch router details from the database fresh at the moment this thread will start working on the router.  That way it will get the freshest view from the database possible.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":765,"context_line":"                    LOG.debug(msg, thread_num, id)"},{"line_number":766,"context_line":""},{"line_number":767,"context_line":"                    # Simulate process the router by taking a REALLY long time."},{"line_number":768,"context_line":"                    eventlet.sleep(30)"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"                    msg \u003d _(\"Carl %d:  Finished processing router \u0027%s\u0027\")"},{"line_number":771,"context_line":"                    LOG.debug(msg, thread_num, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTD0%3D","line":768,"updated":"2014-03-07 04:36:03.000000000","message":"The idea here is that all of the processing done below in _process_routers will be moved here.  Since this code is just to preview the approach I\u0027m looking to take here, it doesn\u0027t actually do anything yet.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            return self.timestamp \u003c other.timestamp"},{"line_number":166,"context_line":"        return self.id \u003c other.id"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class ExclusiveRouterProcessor(object):"},{"line_number":170,"context_line":"    \"\"\"Manager for access to a router for processing"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FDoM%3D","line":168,"updated":"2014-04-24 11:55:24.000000000","message":"I can\u0027t help but feel that ExclusiveRouterProcessor + RouterProcessingQueue are overcomplicated.\n\nI propose something that is not as as simple as I\u0027d like it, but feels more standard / Computer Sciency:\n\nHave N workers, each with their own priority queue (For example N \u003d 4). RPC events and the sync_routers_task push into these queues, so that events for a specific router always end up in the same worker / queue (For example by router_id % N). That\u0027s pretty much it. This way you can get rid of the ExclusiveRouterProcessor concept / class and move to something that I feel is much simpler / easier to comprehend for an average developer.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            return self.timestamp \u003c other.timestamp"},{"line_number":166,"context_line":"        return self.id \u003c other.id"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class ExclusiveRouterProcessor(object):"},{"line_number":170,"context_line":"    \"\"\"Manager for access to a router for processing"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2F3G0%3D","line":168,"in_reply_to":"AAAAXH%2F%2FDoM%3D","updated":"2014-04-25 17:57:41.000000000","message":"This is a good idea.  I did not think of it when I started the implementation.  Let me get through your other comments which are a little more easily actionable and then I\u0027ll see if I can revisit this.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        if router_id in self._locks:"},{"line_number":200,"context_line":"            self._master \u003d self._locks[router_id]"},{"line_number":201,"context_line":"        else:"},{"line_number":202,"context_line":"            self._locks[router_id] \u003d self"},{"line_number":203,"context_line":"        self._locks[router_id] \u003d self"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _i_am_master(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FD%2B0%3D","line":202,"updated":"2014-04-24 11:55:24.000000000","message":"Observing lines 202 and 203, this doesn\u0027t look right...","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        if router_id in self._locks:"},{"line_number":200,"context_line":"            self._master \u003d self._locks[router_id]"},{"line_number":201,"context_line":"        else:"},{"line_number":202,"context_line":"            self._locks[router_id] \u003d self"},{"line_number":203,"context_line":"        self._locks[router_id] \u003d self"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def _i_am_master(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2F3NQ%3D","line":202,"in_reply_to":"AAAAXH%2F%2FD%2B0%3D","updated":"2014-04-25 17:57:41.000000000","message":"You\u0027re right!  How\u0027d that sneak in there?","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def router_updates(self):"},{"line_number":246,"context_line":"        next_update \u003d self._queue.get()"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        with ExclusiveRouterProcessor(id) as rp:"},{"line_number":249,"context_line":"            rp.queue_update(next_update)"},{"line_number":250,"context_line":"            for update in rp.updates():"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FEb4%3D","line":247,"updated":"2014-04-24 11:55:24.000000000","message":"I think next_update.id would work better than the built-in \u0027id\u0027 function ;-)","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def router_updates(self):"},{"line_number":246,"context_line":"        next_update \u003d self._queue.get()"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        with ExclusiveRouterProcessor(id) as rp:"},{"line_number":249,"context_line":"            rp.queue_update(next_update)"},{"line_number":250,"context_line":"            for update in rp.updates():"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2F3L4%3D","line":247,"in_reply_to":"AAAAXH%2F%2FEb4%3D","updated":"2014-04-25 17:57:41.000000000","message":"Another great catch!","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":938,"context_line":"            self._process_routers([router])"},{"line_number":939,"context_line":"            LOG.debug(_(\"Finished a router update for %s\"), update.id)"},{"line_number":940,"context_line":"            rp.fetched_and_processed(update.timestamp)"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"    @periodic_task.periodic_task(spacing\u003d0, run_immediately\u003dTrue)"},{"line_number":943,"context_line":"    def _process_routers_loop(self, context):"},{"line_number":944,"context_line":"        LOG.debug(_(\"Starting _process_routers_loop\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FEis%3D","line":941,"updated":"2014-04-24 11:55:24.000000000","message":"If I understand correctly, there will always be 4 threads spawned that get an update from the queue and act on it. The PriorityQueue.get() method is blocking (Via sleep) if the queue is empty. Line 948 (waitall) should never be reached, and _process_routers_loop never ends.\n\nIf that is true, then why is _process_routers_loop a periodic task? It\u0027s run with spacing\u003d0 and run_immediately\u003dTrue. I gather that it\u0027s only meant to run once, if so, you could override Manager\u0027s after_start, in it start a thread with _process_routers_loop.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":938,"context_line":"            self._process_routers([router])"},{"line_number":939,"context_line":"            LOG.debug(_(\"Finished a router update for %s\"), update.id)"},{"line_number":940,"context_line":"            rp.fetched_and_processed(update.timestamp)"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"    @periodic_task.periodic_task(spacing\u003d0, run_immediately\u003dTrue)"},{"line_number":943,"context_line":"    def _process_routers_loop(self, context):"},{"line_number":944,"context_line":"        LOG.debug(_(\"Starting _process_routers_loop\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2F3H8%3D","line":941,"in_reply_to":"AAAAXH%2F%2FEis%3D","updated":"2014-04-25 17:57:41.000000000","message":"You\u0027re right.  Line 948 will not be reached.  Some of this is due to the fact that I had first implemented it one way and then morphed it in to the incomplete implementation that it is today.\n\nThis doesn\u0027t need to be a periodic task.  I will look in to your suggestion.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"48fe614a1c8f89df05af38aab86e42a19c84f2e0","unresolved":false,"context_lines":[{"line_number":1000,"context_line":"            return"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"        # Two kinds of stale routers:  Routers for which information is cached"},{"line_number":1003,"context_line":"        # in self.router_info and the others.  First, handle the former."},{"line_number":1004,"context_line":"        for router_id in prev_router_ids - set([r[\u0027id\u0027] for r in routers]):"},{"line_number":1005,"context_line":"            update \u003d RouterUpdate(router_id,"},{"line_number":1006,"context_line":"                                  PRIORITY_SYNC_ROUTERS_TASK,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXH%2F%2FEbc%3D","line":1003,"updated":"2014-04-24 11:55:24.000000000","message":"Could you calculate [r[\u0027id\u0027] for r in routers] once? It\u0027s used twice in lines 1004 and 1014.","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"175e818d0b9085cc717af67d02987554dcc4f61d","unresolved":false,"context_lines":[{"line_number":1000,"context_line":"            return"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"        # Two kinds of stale routers:  Routers for which information is cached"},{"line_number":1003,"context_line":"        # in self.router_info and the others.  First, handle the former."},{"line_number":1004,"context_line":"        for router_id in prev_router_ids - set([r[\u0027id\u0027] for r in routers]):"},{"line_number":1005,"context_line":"            update \u003d RouterUpdate(router_id,"},{"line_number":1006,"context_line":"                                  PRIORITY_SYNC_ROUTERS_TASK,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAXX%2F%2F3FY%3D","line":1003,"in_reply_to":"AAAAXH%2F%2FEbc%3D","updated":"2014-04-25 17:57:41.000000000","message":"Done","commit_id":"bc445786b363df5b9f2672cfd105d7e1308fea26"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"47539a232262abf3fc6147be28fdc5e34718a4ca","unresolved":false,"context_lines":[{"line_number":971,"context_line":"        LOG.debug(_(\"Starting _process_routers_loop\"))"},{"line_number":972,"context_line":"        pool \u003d eventlet.GreenPool(size\u003d8)"},{"line_number":973,"context_line":"        while True:"},{"line_number":974,"context_line":"            pool.spawn_n(self._process_router_update)"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"    def _process_router_delete(self):"},{"line_number":977,"context_line":"        current_removed_routers \u003d list(self.removed_routers)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5adbc538_805c7827","line":974,"updated":"2014-05-23 23:05:44.000000000","message":"Is there anything to stop this from looping as fast as possible? I didn\u0027t see something that would sleep in _process_router_update.","commit_id":"48c4e7f19e0728811b3a7a9667d6101c1fc273c8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f629a94bcf58108ca688a647b721076bda8c41b4","unresolved":false,"context_lines":[{"line_number":971,"context_line":"        LOG.debug(_(\"Starting _process_routers_loop\"))"},{"line_number":972,"context_line":"        pool \u003d eventlet.GreenPool(size\u003d8)"},{"line_number":973,"context_line":"        while True:"},{"line_number":974,"context_line":"            pool.spawn_n(self._process_router_update)"},{"line_number":975,"context_line":""},{"line_number":976,"context_line":"    def _process_router_delete(self):"},{"line_number":977,"context_line":"        current_removed_routers \u003d list(self.removed_routers)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5adbc538_375e88ea","line":974,"in_reply_to":"5adbc538_805c7827","updated":"2014-05-24 18:43:55.000000000","message":"Yes, there is.  The call to \"each_update_to_next_router\" begins with a call to \"next_update \u003d self._queue.get()\"  This call will block until an update is available in the queue.  Also, spawn_n will block when there are 8 active threads.  In the case where there are no updates coming in, there will be 8 threads blocked on the queue.","commit_id":"48c4e7f19e0728811b3a7a9667d6101c1fc273c8"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"86b8cb166351f702ac6d8e1ebfa5d86fbf3e7ce6","unresolved":false,"context_lines":[{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    def _process_router_update(self):"},{"line_number":957,"context_line":"        for rp, update in self._queue.each_update_to_next_router():"},{"line_number":958,"context_line":"            LOG.debug(_(\"Starting router update for %s\"), update.id)"},{"line_number":959,"context_line":"            router \u003d update.router"},{"line_number":960,"context_line":"            if update.action !\u003d DELETE_ROUTER and not router:"},{"line_number":961,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_d76ca4d2","line":958,"updated":"2014-07-14 19:25:49.000000000","message":"Nit: debug\u0027s don\u0027t use _() any more, although I can\u0027t find the upstream change that removed them.","commit_id":"df453e4b14ae12f1b6a9cfd364279243b8b0115f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"915434d6500f1044cdf6be7614bfc334168cd33b","unresolved":false,"context_lines":[{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    def _process_router_update(self):"},{"line_number":957,"context_line":"        for rp, update in self._queue.each_update_to_next_router():"},{"line_number":958,"context_line":"            LOG.debug(_(\"Starting router update for %s\"), update.id)"},{"line_number":959,"context_line":"            router \u003d update.router"},{"line_number":960,"context_line":"            if update.action !\u003d DELETE_ROUTER and not router:"},{"line_number":961,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_b71730a2","line":958,"in_reply_to":"baada198_d76ca4d2","updated":"2014-07-14 19:29:55.000000000","message":"Thanks Brian.  This patch has been sitting up here for long enough that I forgot to double check it.","commit_id":"df453e4b14ae12f1b6a9cfd364279243b8b0115f"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"86b8cb166351f702ac6d8e1ebfa5d86fbf3e7ce6","unresolved":false,"context_lines":[{"line_number":976,"context_line":"                continue"},{"line_number":977,"context_line":""},{"line_number":978,"context_line":"            self._process_routers([router])"},{"line_number":979,"context_line":"            LOG.debug(_(\"Finished a router update for %s\"), update.id)"},{"line_number":980,"context_line":"            rp.fetched_and_processed(update.timestamp)"},{"line_number":981,"context_line":""},{"line_number":982,"context_line":"    def _process_routers_loop(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_d7a3c4fd","line":979,"updated":"2014-07-14 19:25:49.000000000","message":"Here too.","commit_id":"df453e4b14ae12f1b6a9cfd364279243b8b0115f"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"86b8cb166351f702ac6d8e1ebfa5d86fbf3e7ce6","unresolved":false,"context_lines":[{"line_number":980,"context_line":"            rp.fetched_and_processed(update.timestamp)"},{"line_number":981,"context_line":""},{"line_number":982,"context_line":"    def _process_routers_loop(self):"},{"line_number":983,"context_line":"        LOG.debug(_(\"Starting _process_routers_loop\"))"},{"line_number":984,"context_line":"        pool \u003d eventlet.GreenPool(size\u003d8)"},{"line_number":985,"context_line":"        while True:"},{"line_number":986,"context_line":"            pool.spawn_n(self._process_router_update)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_77b2f849","line":983,"updated":"2014-07-14 19:25:49.000000000","message":"Here too.","commit_id":"df453e4b14ae12f1b6a9cfd364279243b8b0115f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"d01ddfa1d5106e93f3440565480cf4b9a858c746","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    An instance of this object carries the information necessary to prioritize"},{"line_number":159,"context_line":"    and process a request to update a router."},{"line_number":160,"context_line":"    \"\"\""},{"line_number":161,"context_line":"    def __init__(self, id, priority, action\u003dNone, router\u003dNone, timestamp\u003dNone):"},{"line_number":162,"context_line":"        self.priority \u003d priority"},{"line_number":163,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":164,"context_line":"        if not timestamp:"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_38a5cca1","line":161,"range":{"start_line":161,"start_character":23,"end_line":161,"end_character":25},"updated":"2014-07-14 22:30:24.000000000","message":"please avoid shadowing \"id\".","commit_id":"7a5017bb64b29b70db73c41e2fb724a0009f47fc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f05ef986e3e7b12668c7ae137520db86e20ebc44","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    An instance of this object carries the information necessary to prioritize"},{"line_number":159,"context_line":"    and process a request to update a router."},{"line_number":160,"context_line":"    \"\"\""},{"line_number":161,"context_line":"    def __init__(self, id, priority, action\u003dNone, router\u003dNone, timestamp\u003dNone):"},{"line_number":162,"context_line":"        self.priority \u003d priority"},{"line_number":163,"context_line":"        self.timestamp \u003d timestamp"},{"line_number":164,"context_line":"        if not timestamp:"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_caee96ec","line":161,"in_reply_to":"baada198_38a5cca1","updated":"2014-07-15 15:32:05.000000000","message":"You\u0027re totally right.  I should not be doing that.","commit_id":"7a5017bb64b29b70db73c41e2fb724a0009f47fc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"179c0732e835f15a5657076e3fcb39140945eb43","unresolved":false,"context_lines":[{"line_number":234,"context_line":"                                           datetime.datetime.min)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def fetched_and_processed(self, timestamp):"},{"line_number":237,"context_line":"        \"\"\"Records the data timestamp after it is used to update the router\"\"\""},{"line_number":238,"context_line":"        new_timestamp \u003d max(timestamp, self._get_router_data_timestamp())"},{"line_number":239,"context_line":"        self._router_timestamps[self._router_id] \u003d new_timestamp"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_72fc9873","line":237,"updated":"2014-07-15 18:39:24.000000000","message":"doh...missing period.","commit_id":"fe2ca9a75878a445a54ecfe4a97c79b696abf503"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"179c0732e835f15a5657076e3fcb39140945eb43","unresolved":false,"context_lines":[{"line_number":411,"context_line":"        The argument router_namespaces is the list of all routers namespaces"},{"line_number":412,"context_line":"        The argument router_ids is the list of ids for known routers."},{"line_number":413,"context_line":"        \"\"\""},{"line_number":414,"context_line":"        ns_to_ignore \u003d set(NS_PREFIX + id for id in router_ids)"},{"line_number":415,"context_line":"        ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":416,"context_line":"        self._destroy_stale_router_namespaces(ns_to_destroy)"},{"line_number":417,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_322f80a9","line":414,"updated":"2014-07-15 18:39:24.000000000","message":"not sure if you want to favor \"%s%s\" % (NS_PREFIX, id) rather than concat.","commit_id":"fe2ca9a75878a445a54ecfe4a97c79b696abf503"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"179c0732e835f15a5657076e3fcb39140945eb43","unresolved":false,"context_lines":[{"line_number":961,"context_line":"            if update.action !\u003d DELETE_ROUTER and not router:"},{"line_number":962,"context_line":"                try:"},{"line_number":963,"context_line":"                    update.timestamp \u003d timeutils.utcnow()"},{"line_number":964,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":965,"context_line":"                                                          [update.id])"},{"line_number":966,"context_line":"                except Exception:"},{"line_number":967,"context_line":"                    msg \u003d _(\"Failed to fetch router information for \u0027%s\u0027\")"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_b2ad5035","line":964,"updated":"2014-07-15 18:39:24.000000000","message":"is the rpc call fails then routers won\u0027t be defined, and hence the if at line 973 will blow up. Perhaps it\u0027s unlikely but possible.","commit_id":"fe2ca9a75878a445a54ecfe4a97c79b696abf503"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6517d28805ef8dda4e0d86525b08bb042cf877f4","unresolved":false,"context_lines":[{"line_number":961,"context_line":"            if update.action !\u003d DELETE_ROUTER and not router:"},{"line_number":962,"context_line":"                try:"},{"line_number":963,"context_line":"                    update.timestamp \u003d timeutils.utcnow()"},{"line_number":964,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":965,"context_line":"                                                          [update.id])"},{"line_number":966,"context_line":"                except Exception:"},{"line_number":967,"context_line":"                    msg \u003d _(\"Failed to fetch router information for \u0027%s\u0027\")"}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_cd8f892d","line":964,"in_reply_to":"baada198_b2ad5035","updated":"2014-07-15 18:45:29.000000000","message":"um, on second inspection this looks good.","commit_id":"fe2ca9a75878a445a54ecfe4a97c79b696abf503"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"560203c338fc394fda8f5b6bed7f350fc99c2f2c","unresolved":false,"context_lines":[{"line_number":845,"context_line":"        self.assertEqual([\u00271234\u0027], agent._router_ids())"},{"line_number":846,"context_line":"        self.assertFalse(agent._delete_stale_namespaces)"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    # Carl, add tests here"},{"line_number":849,"context_line":"    def test_process_routers_with_no_ext_net_in_conf(self):"},{"line_number":850,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":851,"context_line":"        self.plugin_api.get_external_network_id.return_value \u003d \u0027aaa\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAVn%2F%2FTBs%3D","line":848,"updated":"2014-03-07 04:36:03.000000000","message":"I will fully unit test the exclusive access manager class.","commit_id":"b3cee457570e8f9fcfef300b51ea8858c317a23a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"47539a232262abf3fc6147be28fdc5e34718a4ca","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for update in not_master.updates():"},{"line_number":114,"context_line":"            raise Exception(\"Only the master should process a router\")"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        self.assertEqual(2, sum([1 for update in master.updates()]))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"class TestBasicRouterOperations(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5adbc538_005f880f","line":116,"updated":"2014-05-23 23:05:44.000000000","message":"The sum method doesn\u0027t seem as intuitive as len() to me. Is there a reason to use it instead?\n\nself.assertEqual(2, len([i for i in master.updates()]))","commit_id":"48c4e7f19e0728811b3a7a9667d6101c1fc273c8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f629a94bcf58108ca688a647b721076bda8c41b4","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        for update in not_master.updates():"},{"line_number":114,"context_line":"            raise Exception(\"Only the master should process a router\")"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        self.assertEqual(2, sum([1 for update in master.updates()]))"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"class TestBasicRouterOperations(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5adbc538_775810fb","line":116,"in_reply_to":"5adbc538_005f880f","updated":"2014-05-24 18:43:55.000000000","message":"Fair enough.  Done.","commit_id":"48c4e7f19e0728811b3a7a9667d6101c1fc273c8"}]}
