)]}'
{"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"6dabca38dc0d81bd4ec8453f3e702efb63663dfa","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        Starts the worker thread, which owns the driver and does our"},{"line_number":123,"context_line":"        periodic resyncs."},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        eventlet.spawn(self._loop)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _loop(self):"},{"line_number":128,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_0bd569e3","line":125,"updated":"2015-09-06 02:00:47.000000000","message":"what will happen if we have an exception in _loop?","commit_id":"5e83b72fb754ca80fe4078165442f9ac8835595a"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"a921120bc0d0016ae54a7653cc055e0893542cfc","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        Starts the worker thread, which owns the driver and does our"},{"line_number":123,"context_line":"        periodic resyncs."},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        eventlet.spawn(self._loop)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _loop(self):"},{"line_number":128,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_53cf9755","line":125,"in_reply_to":"da20952f_0bd569e3","updated":"2015-09-06 10:13:41.000000000","message":"The situation here is the same as for the periodic resync thread that _loop replaces, I think.","commit_id":"5e83b72fb754ca80fe4078165442f9ac8835595a"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"6dabca38dc0d81bd4ec8453f3e702efb63663dfa","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                # update/delete messages below.  Since we don\u0027t yield here,"},{"line_number":155,"context_line":"                # we also can\u0027t build up an unlimited batch."},{"line_number":156,"context_line":"                while not self.queue.empty():"},{"line_number":157,"context_line":"                    batch.append(self.queue.get())"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"                while batch:"},{"line_number":160,"context_line":"                    msg_hndlr, params \u003d batch.pop(0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_4bcfe155","line":157,"updated":"2015-09-06 02:00:47.000000000","message":"nit: queue.get(block\u003dFalse) will be better and quicker?","commit_id":"5e83b72fb754ca80fe4078165442f9ac8835595a"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"a921120bc0d0016ae54a7653cc055e0893542cfc","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                # update/delete messages below.  Since we don\u0027t yield here,"},{"line_number":155,"context_line":"                # we also can\u0027t build up an unlimited batch."},{"line_number":156,"context_line":"                while not self.queue.empty():"},{"line_number":157,"context_line":"                    batch.append(self.queue.get())"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"                while batch:"},{"line_number":160,"context_line":"                    msg_hndlr, params \u003d batch.pop(0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_73e5fbd9","line":157,"in_reply_to":"da20952f_4bcfe155","updated":"2015-09-06 10:13:41.000000000","message":"I don\u0027t understand your suggestion, I\u0027m afraid.\n\nWe clearly still need the \u0027while\u0027 and its condition here, so as to batch as many notifications together as possible.\n\nGiven that we\u0027ve just called .empty(), and so know that there is an item on the queue, what is the point of adding \u0027block\u003dFalse\u0027?","commit_id":"5e83b72fb754ca80fe4078165442f9ac8835595a"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7f961d6b18ad6ff6c136c77682f38186cf3afc85","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self.sync_state()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        while True:"},{"line_number":134,"context_line":"            if self.needs_resync_reasons:"},{"line_number":135,"context_line":"                # be careful to avoid a race with additions to list"},{"line_number":136,"context_line":"                # from other threads"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_cfc75896","line":133,"updated":"2015-09-07 15:11:53.000000000","message":"@utils.exception_logger() decorated the _periodic_resync_helper previously. here if we raised an exception, the loop will exit. so it will fail the dhcp agent","commit_id":"417b6df70d57f9f7c37f841a7e9d33efee0c0e74"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"ee36a4a36d51538d9082cf02d93fc24bcbfaf346","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self.sync_state()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        while True:"},{"line_number":134,"context_line":"            if self.needs_resync_reasons:"},{"line_number":135,"context_line":"                # be careful to avoid a race with additions to list"},{"line_number":136,"context_line":"                # from other threads"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a26ad4f_f89e6e06","line":133,"in_reply_to":"da20952f_2fe294d5","updated":"2015-10-28 03:25:55.000000000","message":"Done","commit_id":"417b6df70d57f9f7c37f841a7e9d33efee0c0e74"},{"author":{"_account_id":13734,"name":"Nell Jerram","email":"nell@tigera.io","username":"neiljerram"},"change_message_id":"2fe9aeb9983b80f509765106aabf1517176c9b0a","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        self.sync_state()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        while True:"},{"line_number":134,"context_line":"            if self.needs_resync_reasons:"},{"line_number":135,"context_line":"                # be careful to avoid a race with additions to list"},{"line_number":136,"context_line":"                # from other threads"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_2fe294d5","line":133,"in_reply_to":"da20952f_cfc75896","updated":"2015-09-07 15:18:35.000000000","message":"Ah, many thanks, I had missed that!\n\nI will certainly address this if and when I respin the change - presumably I just need to add that same decorator to _loop ?  But first I\u0027ll chat with Kevin about whether he wants to proceed with this kind of fix at all.","commit_id":"417b6df70d57f9f7c37f841a7e9d33efee0c0e74"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a1f55c9a849b070773100e22d56e65ebc94cad7a","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                    msg_hndlr, params \u003d batch.pop(0)"},{"line_number":238,"context_line":"                    if (self.dirty_networks and"},{"line_number":239,"context_line":"                            (msg_hndlr not in (self._handle_port_delete,"},{"line_number":240,"context_line":"                                               self._handle_port_update))):"},{"line_number":241,"context_line":"                        # This isn\u0027t a message that we can coalesce, process"},{"line_number":242,"context_line":"                        # any dirty networks now before we handle the message"},{"line_number":243,"context_line":"                        # itself."}],"source_content_type":"text/x-python","patch_set":6,"id":"fa69d971_5a7fc8aa","line":240,"updated":"2016-01-06 02:20:46.000000000","message":"I think this might be getting more complex than it needs to be. You are only batching the port delete and update events, which you\u0027ve already converted into cheap operations that just mark a network as dirty.\n\nSo my suggestion is to get rid of this queue and get rid of the changes to everything except for the port update and delete. Then just have the update and delete methods mark the network as dirty and then have this helper reload the dirty networks.\n\nThat will essentially achieve the same reduction in reload calls without any queue management logic. Does that make sense?","commit_id":"b38e328431b0bd0ff325e1739ac79fda80c692c3"},{"author":{"_account_id":19461,"name":"Shaun Crampton","email":"shaun@tigera.io","username":"fasaxc"},"change_message_id":"e79f5254e901007659ebeb164301fa7f9fb9fce1","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                    msg_hndlr, params \u003d batch.pop(0)"},{"line_number":238,"context_line":"                    if (self.dirty_networks and"},{"line_number":239,"context_line":"                            (msg_hndlr not in (self._handle_port_delete,"},{"line_number":240,"context_line":"                                               self._handle_port_update))):"},{"line_number":241,"context_line":"                        # This isn\u0027t a message that we can coalesce, process"},{"line_number":242,"context_line":"                        # any dirty networks now before we handle the message"},{"line_number":243,"context_line":"                        # itself."}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_da4b462a","line":240,"in_reply_to":"fa69d971_5a7fc8aa","updated":"2016-01-19 11:28:00.000000000","message":"Hi Kevin, I agree, the queue feels a bit overkill to me too but I did have some reasoning behind it:\n\n* it ensures that we only modify the cache from one thread\n* it ensures that we process the updates in the order they arrive so that we\u0027re consistent with the old behaviour (with the exception of skipping reloads that we know aren\u0027t needed); this was a pretty conservative way to code this up, I wanted to make sure that I didn\u0027t break any code that had implicit assumptions that I didn\u0027t fully understand.\n\nI was concerned that updating the cache from the RPC thread(s) but deferring the reload to the worker thread would mean that we\u0027d be modifying the cache under the feet of the worker and I couldn\u0027t convince myself that that was safe.  I think I found an example where the resync thread would be iterating over a structure in the cache while we updated it from the RPC thread.\n\nLocking around the cache wasn\u0027t a good solution because I think we\u0027d need to hold the lock for the duration of the reload.  That\u0027s a problem because reloads can take 1+s so we\u0027d end up with RPC threads blocked on the lock and their work could be reordered as a result.  For example, if we get an RPC call saying a port was created and another one 500ms later saying it was deleted (and those get processed by separate RPC threads), they might both end up being blocked on the same lock and then the delete may be processed first, depending on the scheduler.","commit_id":"b38e328431b0bd0ff325e1739ac79fda80c692c3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1b860e100eb5e51d7e7f787a546c90d5795b4e57","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                    self._reload_dirty_networks()"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"},{"line_number":250,"context_line":"    def _reload_dirty_networks(self):"},{"line_number":251,"context_line":"        \"\"\""},{"line_number":252,"context_line":"        Calls reload_allocations for any networks marked as dirty."},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dae33548_0b943789","line":250,"range":{"start_line":250,"start_character":8,"end_line":250,"end_character":30},"updated":"2016-02-15 16:27:24.000000000","message":"you are taking the lock here as well. I don\u0027t see how this holds the lock for a shorter amount of time than Dim\u0027s patch.","commit_id":"b38e328431b0bd0ff325e1739ac79fda80c692c3"},{"author":{"_account_id":14154,"name":"Takanori Miyagishi","email":"miyagishi.t@jp.fujitsu.com","username":"takanorimiyagishi"},"change_message_id":"f5440bc404e63a346cd1473796d74d6d5d126bfa","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        Parses the message and then queues the operation."},{"line_number":388,"context_line":"        \"\"\""},{"line_number":389,"context_line":"        network_id \u003d payload[\u0027network_id\u0027]"},{"line_number":390,"context_line":"        LOG.debug(\"Network deleted: %s. Up? %s\", network_id)"},{"line_number":391,"context_line":"        self.queue.put((self._handle_network_delete,"},{"line_number":392,"context_line":"                        {\"network_id\": network_id}))"},{"line_number":393,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3afc51ec_d4262bcd","line":390,"updated":"2016-03-14 23:53:34.000000000","message":"Second \"%s\" is not needed to this message.","commit_id":"b38e328431b0bd0ff325e1739ac79fda80c692c3"}]}
