)]}'
{"devstack/plugin.sh":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"05943ea8f62e149a2f910a2a174a30a89517e874","unresolved":false,"context_lines":[{"line_number":141,"context_line":"fi"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"if is_service_enabled df-etcd-pubsub-service ; then"},{"line_number":144,"context_line":"    init_pubsub"},{"line_number":145,"context_line":"    source $DEST/dragonflow/devstack/etcd_pubsub_driver"},{"line_number":146,"context_line":"fi"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7f287b81_b5f726f6","line":144,"range":{"start_line":144,"start_character":0,"end_line":144,"end_character":15},"updated":"2017-08-23 08:41:23.000000000","message":"Is this needed? etcd is broker-based (like redis)","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"9247bf7af0b630db9176f2170e321adc352def76","unresolved":false,"context_lines":[{"line_number":141,"context_line":"fi"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"if is_service_enabled df-etcd-pubsub-service ; then"},{"line_number":144,"context_line":"    init_pubsub"},{"line_number":145,"context_line":"    source $DEST/dragonflow/devstack/etcd_pubsub_driver"},{"line_number":146,"context_line":"fi"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7f287b81_6f40c236","line":144,"range":{"start_line":144,"start_character":0,"end_line":144,"end_character":15},"in_reply_to":"7f287b81_b5f726f6","updated":"2017-08-23 13:09:14.000000000","message":"Will remove","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"}],"dragonflow/db/pubsub_drivers/etcd_pubsub_driver.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"05943ea8f62e149a2f910a2a174a30a89517e874","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                                  port\u003dcfg.CONF.df.remote_db_port)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TopicThread(threading.Thread):"},{"line_number":61,"context_line":"    # TODO"},{"line_number":62,"context_line":"    def __init__(self, ):"},{"line_number":63,"context_line":"        self.daemon \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_f5648ebb","line":60,"range":{"start_line":60,"start_character":6,"end_line":60,"end_character":17},"updated":"2017-08-23 08:41:23.000000000","message":"I think this class is redundant. startWatch can be module-level, and everything else set when the Thread is created via threading.Thread API.","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"6b866e370b41dc0a5c2bec89a7395586becbd0ed","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                                  port\u003dcfg.CONF.df.remote_db_port)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TopicThread(threading.Thread):"},{"line_number":61,"context_line":"    # TODO"},{"line_number":62,"context_line":"    def __init__(self, ):"},{"line_number":63,"context_line":"        self.daemon \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_6d0faa2e","line":60,"range":{"start_line":60,"start_character":6,"end_line":60,"end_character":17},"in_reply_to":"7f287b81_f5648ebb","updated":"2017-08-23 13:58:24.000000000","message":"I need it in order to stop the threads properly.\nRemoved in PS2, but will return :P","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"05943ea8f62e149a2f910a2a174a30a89517e874","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                )"},{"line_number":150,"context_line":"                pass"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def run(self):"},{"line_number":153,"context_line":"        # Not needed"},{"line_number":154,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_b545e619","line":152,"updated":"2017-08-23 08:41:23.000000000","message":"Reminder: You wanted to remove this from the interface (and for good reason)","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"9247bf7af0b630db9176f2170e321adc352def76","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                )"},{"line_number":150,"context_line":"                pass"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def run(self):"},{"line_number":153,"context_line":"        # Not needed"},{"line_number":154,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_5c694623","line":152,"in_reply_to":"7f287b81_b545e619","updated":"2017-08-23 13:09:14.000000000","message":"I\u0027ll upload it with a different patch. Some more modifications are needed in the interface","commit_id":"225eeae3694fb1763eef8977bb571ed1f025c071"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"717109a87bfca211a22455511fd051f696eca99f","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _send_event(self, data, topic):"},{"line_number":54,"context_line":"        topic_prefix \u003d \"/{}/{}\".format(PUBSUB_DB_PREFIX, topic)"},{"line_number":55,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def close(self):"},{"line_number":58,"context_line":"        # TODO"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_5b30c1e8","line":55,"range":{"start_line":55,"start_character":8,"end_line":55,"end_character":43},"updated":"2017-08-28 09:13:56.000000000","message":"Won\u0027t this store the data permanently?","commit_id":"321bdc43ef95c0162389193bdcafbfbe9f48c2b8"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"dc27b24f3f62d1ff237def4628e0eba19866f770","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def _send_event(self, data, topic):"},{"line_number":54,"context_line":"        topic_prefix \u003d \"/{}/{}\".format(PUBSUB_DB_PREFIX, topic)"},{"line_number":55,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def close(self):"},{"line_number":58,"context_line":"        # TODO"}],"source_content_type":"text/x-python","patch_set":3,"id":"ff5d4b2f_eac71c45","line":55,"range":{"start_line":55,"start_character":8,"end_line":55,"end_character":43},"in_reply_to":"7f287b81_5b30c1e8","updated":"2017-09-19 12:13:37.000000000","message":"Yes, but we have a constant numbers of topics.","commit_id":"321bdc43ef95c0162389193bdcafbfbe9f48c2b8"},{"author":{"_account_id":17880,"name":"Shachar Snapiri","email":"shachar.snapiri@toganetworks.com","username":"snapiri"},"change_message_id":"96cbe78b7678595000f0b4ff79bb979c794ca9a5","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from oslo_config import cfg"},{"line_number":19,"context_line":"from oslo_log import log as logging"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# from dragonflow.common import exceptions"},{"line_number":22,"context_line":"from dragonflow.db import pub_sub_api"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_2b02590c","line":21,"updated":"2017-09-27 08:47:44.000000000","message":"Why not remove this line?","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from oslo_config import cfg"},{"line_number":19,"context_line":"from oslo_log import log as logging"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# from dragonflow.common import exceptions"},{"line_number":22,"context_line":"from dragonflow.db import pub_sub_api"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_18692720","line":21,"in_reply_to":"7f515b1d_2b02590c","updated":"2017-09-27 15:25:15.000000000","message":"Will remove","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":17880,"name":"Shachar Snapiri","email":"shachar.snapiri@toganetworks.com","username":"snapiri"},"change_message_id":"96cbe78b7678595000f0b4ff79bb979c794ca9a5","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _send_event(self, data, topic):"},{"line_number":59,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":60,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def close(self):"},{"line_number":63,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_fdef681b","line":60,"updated":"2017-09-27 08:47:44.000000000","message":"What if client is None? Is it possible anyway?","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _send_event(self, data, topic):"},{"line_number":59,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":60,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def close(self):"},{"line_number":63,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_b8057348","line":60,"in_reply_to":"7f515b1d_fdef681b","updated":"2017-09-27 15:25:15.000000000","message":"The publisher is initialize when the publisher service is up, so it shouldn\u0027t happen.\nBut I\u0027ll add a validation in case we want to create the publisher from a different place","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"8462f006c6a425bb3e2dcd9a939d47b1baa1a37c","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def startWatch(self, topic, handle_event):"},{"line_number":74,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":75,"context_line":"        events, self._cancel \u003d self.client.watch(topic_prefix)"},{"line_number":76,"context_line":"        for event in events:"},{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_6db3bb4e","line":75,"updated":"2017-09-27 14:33:09.000000000","message":"Isn\u0027t it\u0027 better to declare all instance variable in the __init__ ?","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"ba6bcffce715a0a41bb43c3eff71e0f6c029f649","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def startWatch(self, topic, handle_event):"},{"line_number":74,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":75,"context_line":"        events, self._cancel \u003d self.client.watch(topic_prefix)"},{"line_number":76,"context_line":"        for event in events:"},{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_cbf03e94","line":75,"in_reply_to":"7f515b1d_3a1f225c","updated":"2017-09-28 10:01:54.000000000","message":"I\u0027ll initialize it with None. Good idea","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def startWatch(self, topic, handle_event):"},{"line_number":74,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":75,"context_line":"        events, self._cancel \u003d self.client.watch(topic_prefix)"},{"line_number":76,"context_line":"        for event in events:"},{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_b82693cd","line":75,"in_reply_to":"7f515b1d_6db3bb4e","updated":"2017-09-27 15:25:15.000000000","message":"I don\u0027t want to initialize client.watch from outside of the thread running scope","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"7ddc22b10673148c6dc135bd6957ad801f70148f","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def startWatch(self, topic, handle_event):"},{"line_number":74,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":75,"context_line":"        events, self._cancel \u003d self.client.watch(topic_prefix)"},{"line_number":76,"context_line":"        for event in events:"},{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_3a1f225c","line":75,"in_reply_to":"7f515b1d_b82693cd","updated":"2017-09-28 07:27:11.000000000","message":"Well ,I am still not fully familiar with the coding-convention, \nBut it\u0027s looks for me much order to declare about your instance variable in the __init__ ,  even to set then to None.","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":17880,"name":"Shachar Snapiri","email":"shachar.snapiri@toganetworks.com","username":"snapiri"},"change_message_id":"96cbe78b7678595000f0b4ff79bb979c794ca9a5","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def cancel(self):"},{"line_number":80,"context_line":"        self._cancel()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"class EtcdSubscriberAgent(pub_sub_api.SubscriberApi):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_dd570cca","line":80,"updated":"2017-09-27 08:47:44.000000000","message":"Shouldn\u0027t this be initialized to \u0027not None\u0027 somewhere?","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            handle_event(event)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def cancel(self):"},{"line_number":80,"context_line":"        self._cancel()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"class EtcdSubscriberAgent(pub_sub_api.SubscriberApi):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_3301a406","line":80,"in_reply_to":"7f515b1d_dd570cca","updated":"2017-09-27 15:25:15.000000000","message":"Will fix","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"8462f006c6a425bb3e2dcd9a939d47b1baa1a37c","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        super(EtcdSubscriberAgent, self).__init__()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def initialize(self, callback):"},{"line_number":92,"context_line":"        self.db_changes_callback \u003d callback"},{"line_number":93,"context_line":"        self.stop_event \u003d threading.Event()"},{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_4d647f4a","line":92,"updated":"2017-09-27 14:33:09.000000000","message":"same here ..","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        super(EtcdSubscriberAgent, self).__init__()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def initialize(self, callback):"},{"line_number":92,"context_line":"        self.db_changes_callback \u003d callback"},{"line_number":93,"context_line":"        self.stop_event \u003d threading.Event()"},{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_73b6fc40","line":92,"in_reply_to":"7f515b1d_4d647f4a","updated":"2017-09-27 15:25:15.000000000","message":"This is part of the subscriber API [1] . I can fix this in a different patch.\n\n[1] https://github.com/openstack/dragonflow/blob/master/dragonflow/db/pub_sub_api.py#L154","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"7ddc22b10673148c6dc135bd6957ad801f70148f","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        super(EtcdSubscriberAgent, self).__init__()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def initialize(self, callback):"},{"line_number":92,"context_line":"        self.db_changes_callback \u003d callback"},{"line_number":93,"context_line":"        self.stop_event \u003d threading.Event()"},{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_7a9c7abf","line":92,"in_reply_to":"7f515b1d_73b6fc40","updated":"2017-09-28 07:27:11.000000000","message":"I think the API is OK  , \nBut like you declare on \"self.client \u003d None\" in __init__ , \nIt\u0027s possible to do the same with self.db_changes_callback.","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"ba6bcffce715a0a41bb43c3eff71e0f6c029f649","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        super(EtcdSubscriberAgent, self).__init__()"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def initialize(self, callback):"},{"line_number":92,"context_line":"        self.db_changes_callback \u003d callback"},{"line_number":93,"context_line":"        self.stop_event \u003d threading.Event()"},{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_cb45deb5","line":92,"in_reply_to":"7f515b1d_7a9c7abf","updated":"2017-09-28 10:01:54.000000000","message":"Will add","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"8462f006c6a425bb3e2dcd9a939d47b1baa1a37c","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def _get_topic_thread(self, topic):"},{"line_number":98,"context_line":"        topic_thread \u003d WatcherThread("},{"line_number":99,"context_line":"            etcd_client\u003dself.client,"},{"line_number":100,"context_line":"            kwargs\u003d{\u0027topic\u0027: topic,"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_8d4dd7c5","line":97,"updated":"2017-09-27 14:33:09.000000000","message":"maybe \"_create_topic_thread\" ?","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        self.client \u003d etcd3gw.client(host\u003dcfg.CONF.df.remote_db_ip,"},{"line_number":95,"context_line":"                                     port\u003dcfg.CONF.df.remote_db_port)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def _get_topic_thread(self, topic):"},{"line_number":98,"context_line":"        topic_thread \u003d WatcherThread("},{"line_number":99,"context_line":"            etcd_client\u003dself.client,"},{"line_number":100,"context_line":"            kwargs\u003d{\u0027topic\u0027: topic,"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_538c207e","line":97,"in_reply_to":"7f515b1d_8d4dd7c5","updated":"2017-09-27 15:25:15.000000000","message":"Will change","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"8462f006c6a425bb3e2dcd9a939d47b1baa1a37c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            topic_thread \u003d self._get_topic_thread(topic)"},{"line_number":119,"context_line":"            self.topic_list[topic] \u003d topic_thread"},{"line_number":120,"context_line":"            if self.running:"},{"line_number":121,"context_line":"                topic_thread.start()"},{"line_number":122,"context_line":"            return True"},{"line_number":123,"context_line":"        return False"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_6d297b99","line":121,"updated":"2017-09-27 14:33:09.000000000","message":"Is it possible to add all the watch\u0027s in the same thread and use a-sync-io ? a thread per topic sound very expensive...","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"5121d341ac7d17ea6384b16f1b09b90288719872","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            topic_thread \u003d self._get_topic_thread(topic)"},{"line_number":119,"context_line":"            self.topic_list[topic] \u003d topic_thread"},{"line_number":120,"context_line":"            if self.running:"},{"line_number":121,"context_line":"                topic_thread.start()"},{"line_number":122,"context_line":"            return True"},{"line_number":123,"context_line":"        return False"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_93497832","line":121,"in_reply_to":"7f515b1d_6d297b99","updated":"2017-09-27 15:25:15.000000000","message":"We are using eventlet.monkey_patch(). The threads are actually green threads, so they are already a-sync-io.\nCreating a topic per thread is not that expensive (for now) because we have a constant (and rather small) numbers of topics.","commit_id":"eb380b9173c3dd0fdc130d833b71984ff160ca75"},{"author":{"_account_id":17880,"name":"Shachar Snapiri","email":"shachar.snapiri@toganetworks.com","username":"snapiri"},"change_message_id":"ffeffbad967f276a990e8336e0b20a98ec68ed1a","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            self._stop_topic_watch(self.topic_list[topic])"},{"line_number":132,"context_line":"        del self.topic_list[topic]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _stop_topic_watch(self, topic_thread):"},{"line_number":135,"context_line":"        topic_thread.cancel()"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def handle_event(self, event):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_4ebf4bfb","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":25},"updated":"2017-10-19 06:01:32.000000000","message":"How about renaming to _stop_topic_thread? This is actually what it does and it is consistent with _create_topic_thread and topic_thread.start....","commit_id":"781039408459595c6431c01e20761d396a8337d2"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"15f0fe2a7167590f5aaad3a48ad1fe7dc9a7b52c","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            self._stop_topic_watch(self.topic_list[topic])"},{"line_number":132,"context_line":"        del self.topic_list[topic]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _stop_topic_watch(self, topic_thread):"},{"line_number":135,"context_line":"        topic_thread.cancel()"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def handle_event(self, event):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_710f862e","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":25},"in_reply_to":"3f4b6375_4ebf4bfb","updated":"2017-10-19 06:41:02.000000000","message":"Done","commit_id":"781039408459595c6431c01e20761d396a8337d2"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":59,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def close(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class WatcherThread(threading.Thread):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_6d7bb8f4","line":62,"range":{"start_line":61,"start_character":0,"end_line":62,"end_character":12},"updated":"2017-10-24 13:53:26.000000000","message":"No need to close the client?","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        topic_prefix \u003d _get_topic_watch_prefix(topic)"},{"line_number":59,"context_line":"        self.client.put(topic_prefix, data)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def close(self):"},{"line_number":62,"context_line":"        pass"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class WatcherThread(threading.Thread):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_a6b66d3d","line":62,"range":{"start_line":61,"start_character":0,"end_line":62,"end_character":12},"in_reply_to":"3f4b6375_6d7bb8f4","updated":"2017-10-24 14:58:57.000000000","message":"Since we are using the default put method of the db_driver, no constant session is maintained. Each \u0027put\u0027 is a different post request","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"class EtcdSubscriberAgent(pub_sub_api.SubscriberApi):"},{"line_number":85,"context_line":"    def __init__(self):"},{"line_number":86,"context_line":"        self.topic_list \u003d {}"},{"line_number":87,"context_line":"        self.uri_list \u003d []"},{"line_number":88,"context_line":"        self.running \u003d False"},{"line_number":89,"context_line":"        self.client \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_cd02ac3d","line":86,"range":{"start_line":86,"start_character":13,"end_line":86,"end_character":23},"updated":"2017-10-24 13:53:26.000000000","message":"Name suggests a list, value suggests dictionary :(","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"class EtcdSubscriberAgent(pub_sub_api.SubscriberApi):"},{"line_number":85,"context_line":"    def __init__(self):"},{"line_number":86,"context_line":"        self.topic_list \u003d {}"},{"line_number":87,"context_line":"        self.uri_list \u003d []"},{"line_number":88,"context_line":"        self.running \u003d False"},{"line_number":89,"context_line":"        self.client \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_06f661fa","line":86,"range":{"start_line":86,"start_character":13,"end_line":86,"end_character":23},"in_reply_to":"3f4b6375_cd02ac3d","updated":"2017-10-24 14:58:57.000000000","message":"Will change :)","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def close(self):"},{"line_number":114,"context_line":"        self.running \u003d False"},{"line_number":115,"context_line":"        for topic in self.topic_list:"},{"line_number":116,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def register_topic(self, topic):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_4df7dc60","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":37},"updated":"2017-10-24 13:53:26.000000000","message":"nit: can spare a lookup\n\n  for topic, thread in self.topic_list.items()","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def close(self):"},{"line_number":114,"context_line":"        self.running \u003d False"},{"line_number":115,"context_line":"        for topic in self.topic_list:"},{"line_number":116,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def register_topic(self, topic):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_46da194c","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":37},"in_reply_to":"3f4b6375_4df7dc60","updated":"2017-10-24 14:58:57.000000000","message":"Will change","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def close(self):"},{"line_number":114,"context_line":"        self.running \u003d False"},{"line_number":115,"context_line":"        for topic in self.topic_list:"},{"line_number":116,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def register_topic(self, topic):"},{"line_number":119,"context_line":"        LOG.info(\u0027Register topic %s\u0027, topic)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_cdd98cf3","line":116,"updated":"2017-10-24 13:53:26.000000000","message":"nit: Close client?","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":113,"context_line":"    def close(self):"},{"line_number":114,"context_line":"        self.running \u003d False"},{"line_number":115,"context_line":"        for topic in self.topic_list:"},{"line_number":116,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def register_topic(self, topic):"},{"line_number":119,"context_line":"        LOG.info(\u0027Register topic %s\u0027, topic)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_8616d1f0","line":116,"in_reply_to":"3f4b6375_cdd98cf3","updated":"2017-10-24 14:58:57.000000000","message":"Same as before. etcd3gw does not maintains active connections  to etcd.","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def unregister_topic(self, topic):"},{"line_number":129,"context_line":"        LOG.info(\u0027Unregister topic %s\u0027, topic)"},{"line_number":130,"context_line":"        if self.running:"},{"line_number":131,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":132,"context_line":"        del self.topic_list[topic]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_6dc058e2","line":130,"range":{"start_line":130,"start_character":11,"end_line":130,"end_character":15},"updated":"2017-10-24 13:53:26.000000000","message":"nit: can spare an extra lookup\n\nthread \u003d self.topic_list.pop(topic)\nif self.running:\n    self._stop_topic(thread)","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def unregister_topic(self, topic):"},{"line_number":129,"context_line":"        LOG.info(\u0027Unregister topic %s\u0027, topic)"},{"line_number":130,"context_line":"        if self.running:"},{"line_number":131,"context_line":"            self._stop_topic_thread(self.topic_list[topic])"},{"line_number":132,"context_line":"        del self.topic_list[topic]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_e6e8e5e2","line":130,"range":{"start_line":130,"start_character":11,"end_line":130,"end_character":15},"in_reply_to":"3f4b6375_6dc058e2","updated":"2017-10-24 14:58:57.000000000","message":"Will change","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"9fa3797747f04d6828ca9bf3399da9a57266502b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        topic_thread.cancel()"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def handle_event(self, event):"},{"line_number":138,"context_line":"        unpacked_event \u003d pub_sub_api.unpack_message(event[\"kv\"][\"value\"])"},{"line_number":139,"context_line":"        self.db_changes_callback("},{"line_number":140,"context_line":"            unpacked_event[\u0027table\u0027],"},{"line_number":141,"context_line":"            unpacked_event[\u0027key\u0027],"},{"line_number":142,"context_line":"            unpacked_event[\u0027action\u0027],"},{"line_number":143,"context_line":"            unpacked_event[\u0027value\u0027],"},{"line_number":144,"context_line":"            unpacked_event[\u0027topic\u0027],"},{"line_number":145,"context_line":"        )"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def process_ha(self):"},{"line_number":148,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_cd5e2c43","line":145,"range":{"start_line":138,"start_character":8,"end_line":145,"end_character":9},"updated":"2017-10-24 13:53:26.000000000","message":"Can replace with:\n\n\n self._handle_incoming_event(event[\u0027kv\u0027][\u0027value\u0027])","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"99affc520562e90f507037d502c7c79a64dc16e0","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        topic_thread.cancel()"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def handle_event(self, event):"},{"line_number":138,"context_line":"        unpacked_event \u003d pub_sub_api.unpack_message(event[\"kv\"][\"value\"])"},{"line_number":139,"context_line":"        self.db_changes_callback("},{"line_number":140,"context_line":"            unpacked_event[\u0027table\u0027],"},{"line_number":141,"context_line":"            unpacked_event[\u0027key\u0027],"},{"line_number":142,"context_line":"            unpacked_event[\u0027action\u0027],"},{"line_number":143,"context_line":"            unpacked_event[\u0027value\u0027],"},{"line_number":144,"context_line":"            unpacked_event[\u0027topic\u0027],"},{"line_number":145,"context_line":"        )"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def process_ha(self):"},{"line_number":148,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f4b6375_a69c2d6a","line":145,"range":{"start_line":138,"start_character":8,"end_line":145,"end_character":9},"in_reply_to":"3f4b6375_cd5e2c43","updated":"2017-10-24 14:58:57.000000000","message":"I\u0027m not using SubscriberAgentBase, so I don\u0027t have this method","commit_id":"51b85e265e8341b69bb72c65e75b7beaafbd39c3"}]}
