)]}'
{"networking_ovn/ml2/mech_driver.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"4382f62ac6aaf30aff2fbafd187c78ed56ca6ce9","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    def post_fork_initialize(self, resource, event, trigger, payload\u003dNone):"},{"line_number":161,"context_line":"        # NOTE(rtheis): This will initialize all workers (API, RPC,"},{"line_number":162,"context_line":"        # plugin service and OVN) with OVN IDL connections."},{"line_number":163,"context_line":"        self._nb_ovn, self._sb_ovn \u003d impl_idl_ovn.get_ovn_idls(self,"},{"line_number":164,"context_line":"                                                               trigger)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        if trigger.im_class \u003d\u003d ovsdb_monitor.OvnWorker:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_6ded5bee","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":34},"updated":"2017-11-13 06:03:04.000000000","message":"i\u0027m not sure how this patch fixes the race.\nuntil _nb_ovn and _sb_ovn are initialized, _ovn_client still returns None, doesn\u0027t it?","commit_id":"0e4834d7e9454b93ac37382fa16b5fd7de79dd5c"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"96386028698304910e56f24a71e899eed88f08cf","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    def post_fork_initialize(self, resource, event, trigger, payload\u003dNone):"},{"line_number":161,"context_line":"        # NOTE(rtheis): This will initialize all workers (API, RPC,"},{"line_number":162,"context_line":"        # plugin service and OVN) with OVN IDL connections."},{"line_number":163,"context_line":"        self._nb_ovn, self._sb_ovn \u003d impl_idl_ovn.get_ovn_idls(self,"},{"line_number":164,"context_line":"                                                               trigger)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        if trigger.im_class \u003d\u003d ovsdb_monitor.OvnWorker:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_8d765706","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":34},"in_reply_to":"1f485f77_6ded5bee","updated":"2017-11-13 06:20:51.000000000","message":"Exactly. However, this still fixes the race because we are trying to use _ovn_client in the database event handlers which means that we already have those initialized and connected to both dbs. Unless I missed something I think we are safe with this.","commit_id":"0e4834d7e9454b93ac37382fa16b5fd7de79dd5c"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"539f04c993557477181123162acf5d29ee609fe1","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    def post_fork_initialize(self, resource, event, trigger, payload\u003dNone):"},{"line_number":161,"context_line":"        # NOTE(rtheis): This will initialize all workers (API, RPC,"},{"line_number":162,"context_line":"        # plugin service and OVN) with OVN IDL connections."},{"line_number":163,"context_line":"        self._nb_ovn, self._sb_ovn \u003d impl_idl_ovn.get_ovn_idls(self,"},{"line_number":164,"context_line":"                                                               trigger)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        if trigger.im_class \u003d\u003d ovsdb_monitor.OvnWorker:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_f856a206","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":34},"in_reply_to":"1f485f77_8d765706","updated":"2017-11-13 10:24:21.000000000","message":"Hmm if it tries to use it and it returns None, wouldn\u0027t it raise an AttributeError somewhere, like \"None has no attribute X\" ? Is it being handled somewhere ?\n\nIdeally, if self._ovn_client_inst, sef._nb_ovn and self._sb_ovn is None we should try to connect to the DB inside the method/@property that calls it. Or perhaps raise a proper exception that can be handled in the event handlers ?","commit_id":"0e4834d7e9454b93ac37382fa16b5fd7de79dd5c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"61d6ea008ef12cb639178138a68f36386b61020a","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    def post_fork_initialize(self, resource, event, trigger, payload\u003dNone):"},{"line_number":161,"context_line":"        # NOTE(rtheis): This will initialize all workers (API, RPC,"},{"line_number":162,"context_line":"        # plugin service and OVN) with OVN IDL connections."},{"line_number":163,"context_line":"        self._nb_ovn, self._sb_ovn \u003d impl_idl_ovn.get_ovn_idls(self,"},{"line_number":164,"context_line":"                                                               trigger)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        if trigger.im_class \u003d\u003d ovsdb_monitor.OvnWorker:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f485f77_48d28d5e","line":163,"range":{"start_line":163,"start_character":8,"end_line":163,"end_character":34},"in_reply_to":"1f485f77_8d765706","updated":"2017-11-13 07:49:56.000000000","message":"here _nb_ovn and _ob_ovn are assigned only after get_ovn_idls, which started the connection, returned, right?\nwhile i\u0027m not sure if it\u0027s actually safe or not (it depends on where this thread can yield), it seems fragile.\ni guess it\u0027s clearer to tweak the api to separate __init__ and connection starting.\nhow do you think?","commit_id":"0e4834d7e9454b93ac37382fa16b5fd7de79dd5c"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"30dbc4e03b86adaf53ba37a4d375bdb180a2ceef","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    @property"},{"line_number":109,"context_line":"    def _ovn_client(self):"},{"line_number":110,"context_line":"        if self._ovn_client_inst is None:"},{"line_number":111,"context_line":"            if not(self._nb_ovn and self._sb_ovn):"},{"line_number":112,"context_line":"                # Wait until the post_fork_initialize method has finished and"},{"line_number":113,"context_line":"                # IDLs have been correctly setup."},{"line_number":114,"context_line":"                self._post_fork_event.wait()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_aa717e46","line":111,"updated":"2017-11-16 17:48:15.000000000","message":"Can\u0027t we just unconditionally call self._post_fork_event.wait() here since waiting would ensure that they exist?","commit_id":"48e9101d6850de63ae3c4a117c13876c47392006"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"3f119598c9acf53598ee799569be4c4a696d2613","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    @property"},{"line_number":109,"context_line":"    def _ovn_client(self):"},{"line_number":110,"context_line":"        if self._ovn_client_inst is None:"},{"line_number":111,"context_line":"            if not(self._nb_ovn and self._sb_ovn):"},{"line_number":112,"context_line":"                # Wait until the post_fork_initialize method has finished and"},{"line_number":113,"context_line":"                # IDLs have been correctly setup."},{"line_number":114,"context_line":"                self._post_fork_event.wait()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_5d408da5","line":111,"in_reply_to":"1f485f77_6a7f06e0","updated":"2017-11-16 21:44:54.000000000","message":"Yeah, I think for those tests we could simply mock threading.Event() at the base class. That said, having it inside the conditions (as-is now) is OK as well.","commit_id":"48e9101d6850de63ae3c4a117c13876c47392006"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"2f74a30f7b86b3355fbf3eab7213fe522070f907","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    @property"},{"line_number":109,"context_line":"    def _ovn_client(self):"},{"line_number":110,"context_line":"        if self._ovn_client_inst is None:"},{"line_number":111,"context_line":"            if not(self._nb_ovn and self._sb_ovn):"},{"line_number":112,"context_line":"                # Wait until the post_fork_initialize method has finished and"},{"line_number":113,"context_line":"                # IDLs have been correctly setup."},{"line_number":114,"context_line":"                self._post_fork_event.wait()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1f485f77_6a7f06e0","line":111,"in_reply_to":"1f485f77_aa717e46","updated":"2017-11-16 17:53:38.000000000","message":"Yes... I thought that if we had those already initialized we could use ovn_client safely and less risk of waiting forever. Also there\u0027re many tests that are using _ovn_client and initializing _nb_ovn and _sb_ovn themselves (not going through the post_fork_initialize method) and they timed out because noone set the event.","commit_id":"48e9101d6850de63ae3c4a117c13876c47392006"}]}
