)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"eac5b22db444c1e8f48f22e69e7a67fa030dc776","unresolved":false,"context_lines":[{"line_number":16,"context_line":"multiple threads and process environments that keystone might"},{"line_number":17,"context_line":"be running. E.g. do we have to make the notification public so"},{"line_number":18,"context_line":"that all keystone processes will update their internal driver"},{"line_number":19,"context_line":"structures."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Partially Implements: blueprint domain-config-ext"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a80dd14_fc29da37","line":19,"updated":"2015-03-12 16:30:28.000000000","message":"Keystone does not listen to notifications at this point on the wire, and I\u0027d like to avoid doing that. I am unsure how to handle this however, short of doing a periodic cache+reload of the config.\n\nSo lets think very clearly about how we communicate this across processes without notifying to the wire and hoping that a fanout catches all keystone workers.\n\nOptions that come to mind:\n\n1. Timed cache, when you load the config you look at when it was last updated and check in at a fixed interval (meaning that any/all requests would be updated at the same time, vs. some threads/workers do not update at the same time).\n\n2. Keep an identifier for the \"version\" of the config that is handled via a light-weight query. if the version does not match in-memory state, you reload config.\n\n3. Simple timed cache, knowing that we reload at x interval, so changes need to either be a restart of keystone or wait for interval X to fully apply.\n\n4. ???","commit_id":"ea242e52a92c2746c5a2610c3650410e4f6936eb"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4f0964a27e9b51c8fe2cee55ffc9a57a8a275f81","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Reload drivers when their domain config is updated"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a domain config is modifed, in order for those configs"},{"line_number":10,"context_line":"to actual be live, we need to re-initialise the backend"},{"line_number":11,"context_line":"identity driver for the respective domain."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch uses cache timeouts to ensure that new config options"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa963961_b0ad9a33","line":10,"updated":"2015-03-26 19:10:50.000000000","message":"actually*","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"29e60d785fe42294447d14582bc45a35cc60f5aa","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Reload drivers when their domain config is updated"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a domain config is modifed, in order for those configs"},{"line_number":10,"context_line":"to actual be live, we need to re-initialise the backend"},{"line_number":11,"context_line":"identity driver for the respective domain."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch uses cache timeouts to ensure that new config options"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"fa963961_4437acb0","line":10,"in_reply_to":"fa963961_b0ad9a33","updated":"2015-03-26 20:37:26.000000000","message":"Done","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"}],"keystone/identity/core.py":[{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"3945ce80c1f26dd4e202b860a695f4b90b31fbb5","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                not CONF.identity.domain_configurations_from_database):"},{"line_number":264,"context_line":"            return"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        # When the domain specific drivers where set up, we stored away"},{"line_number":267,"context_line":"        # the domain specific config that was available at that time."},{"line_number":268,"context_line":"        # So we now read the current version and compare. While this might"},{"line_number":269,"context_line":"        # seem somewhat inefficient, the sensitive config call is"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_6b1dc7bd","line":266,"updated":"2015-03-20 13:45:51.000000000","message":"s/where/were","commit_id":"a8cb19278d9e25ad9fc5942f26d9753a817f02e3"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"ea3b69ccf6bbb76e14eed0c15b64856ecab94530","unresolved":false,"context_lines":[{"line_number":263,"context_line":"                not CONF.identity.domain_configurations_from_database):"},{"line_number":264,"context_line":"            return"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        # When the domain specific drivers where set up, we stored away"},{"line_number":267,"context_line":"        # the domain specific config that was available at that time."},{"line_number":268,"context_line":"        # So we now read the current version and compare. While this might"},{"line_number":269,"context_line":"        # seem somewhat inefficient, the sensitive config call is"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6ced46_aa219e4e","line":266,"in_reply_to":"9a80dd14_6b1dc7bd","updated":"2015-03-26 10:21:48.000000000","message":"Done","commit_id":"a8cb19278d9e25ad9fc5942f26d9753a817f02e3"},{"author":{"_account_id":10917,"name":"Gabriel Bezerra","email":"gabrielb@lsd.ufcg.edu.br","username":"gabriel.bezerra"},"change_message_id":"a078c0b65c8d215c51606d0674d6b2dcc6de3acc","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        # cached, so should be light weight.  More importantly, when the"},{"line_number":271,"context_line":"        # cache timeout is reached, we will get any config that has been"},{"line_number":272,"context_line":"        # updated from any other keystone process."},{"line_number":273,"context_line":"        domain_config_options \u003d ("},{"line_number":274,"context_line":"            self.domain_config_api."},{"line_number":275,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":276,"context_line":"        if domain_config_options:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_7a92ee9f","line":273,"updated":"2015-03-20 14:21:15.000000000","message":"What about a more self documenting code snippet?\n\n        configs_in_the_database \u003d (\n            self.domain_config_api.\n            get_config_with_sensitive_info(domain_id))\n\n        a_config_is_loaded \u003d domain_id in self\n        def the_current_config_is_different_from(new_config):\n            return new_config !\u003d self[domain_id][\u0027cfg_overrides\u0027]\n\n        if configs_in_the_database:\n            if (not a_config_is_loaded or\n                    the_current_config_is_different_from(configs_in_the_database)):\n                self._load_config_from_database(domain_id,\t\n                                                domain_config_options)\n        elif a_config_is_loaded:\n            self.pop(domain_id)","commit_id":"a8cb19278d9e25ad9fc5942f26d9753a817f02e3"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"ea3b69ccf6bbb76e14eed0c15b64856ecab94530","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        # cached, so should be light weight.  More importantly, when the"},{"line_number":271,"context_line":"        # cache timeout is reached, we will get any config that has been"},{"line_number":272,"context_line":"        # updated from any other keystone process."},{"line_number":273,"context_line":"        domain_config_options \u003d ("},{"line_number":274,"context_line":"            self.domain_config_api."},{"line_number":275,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":276,"context_line":"        if domain_config_options:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6ced46_c5940d8d","line":273,"in_reply_to":"9a80dd14_7a92ee9f","updated":"2015-03-26 10:21:48.000000000","message":"I added some of those ideas - thanks","commit_id":"a8cb19278d9e25ad9fc5942f26d9753a817f02e3"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"a34bd6bc6bd8e838f800e65cf1c614e92bc32591","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        until all references to it have been broken. When that other"},{"line_number":274,"context_line":"        thread is released back and is restarted with another command to"},{"line_number":275,"context_line":"        process, next time it comes to access the driver it will pickup"},{"line_number":276,"context_line":"        the new one."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        \"\"\""},{"line_number":279,"context_line":"        if (not CONF.identity.domain_specific_drivers_enabled or"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa963961_bd72187b","line":276,"updated":"2015-03-26 17:10:11.000000000","message":"nice doc!","commit_id":"9db0165c84fac2fcc428b548185a2d7d23ac1af5"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4f0964a27e9b51c8fe2cee55ffc9a57a8a275f81","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        now read the current version and compare. While this might seem"},{"line_number":264,"context_line":"        somewhat inefficient, the sensitive config call is cached, so should be"},{"line_number":265,"context_line":"        light weight. More importantly, when the cache timeout is reached, we"},{"line_number":266,"context_line":"        will get any config that has been updated from any other keystone"},{"line_number":267,"context_line":"        process."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        This cache-timeout approach should work both in multi-process and"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa963961_304f4a94","line":266,"updated":"2015-03-26 19:10:50.000000000","message":"Keystone* \n\napplies to the rest of the comment.","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"38cdd9803abfa3a7d33b7f6c09af458184dd5979","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        now read the current version and compare. While this might seem"},{"line_number":264,"context_line":"        somewhat inefficient, the sensitive config call is cached, so should be"},{"line_number":265,"context_line":"        light weight. More importantly, when the cache timeout is reached, we"},{"line_number":266,"context_line":"        will get any config that has been updated from any other keystone"},{"line_number":267,"context_line":"        process."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        This cache-timeout approach should work both in multi-process and"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa963961_d35ee844","line":266,"in_reply_to":"fa963961_304f4a94","updated":"2015-03-26 19:36:20.000000000","message":"actually, the naming convention is to use \"keystone\"","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4f0964a27e9b51c8fe2cee55ffc9a57a8a275f81","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                self._load_config_from_database(domain_id,"},{"line_number":296,"context_line":"                                                latest_domain_config)"},{"line_number":297,"context_line":"        elif domain_config_in_use:"},{"line_number":298,"context_line":"            self.pop(domain_id)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa963961_30362a04","line":298,"updated":"2015-03-26 19:10:50.000000000","message":"can we use delete here if we don\u0027t need the value returned from pop()?","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"29e60d785fe42294447d14582bc45a35cc60f5aa","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                self._load_config_from_database(domain_id,"},{"line_number":296,"context_line":"                                                latest_domain_config)"},{"line_number":297,"context_line":"        elif domain_config_in_use:"},{"line_number":298,"context_line":"            self.pop(domain_id)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa963961_648d107b","line":298,"in_reply_to":"fa963961_30362a04","updated":"2015-03-26 20:37:26.000000000","message":"yeah, probably better. Will fix that.","commit_id":"f3326ed43af7656504eb45f87e113ce93bb6b719"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        domain_config[\u0027cfg_overrides\u0027] \u003d specific_config"},{"line_number":192,"context_line":"        domain_config[\u0027driver\u0027] \u003d self._load_driver(domain_config)"},{"line_number":193,"context_line":"        self._assert_no_more_than_one_sql_driver(domain_id, domain_config)"},{"line_number":194,"context_line":"        self[domain_id] \u003d domain_config"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _setup_domain_drivers_from_database(self, standard_driver,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_09209b9a","line":193,"updated":"2015-03-30 00:12:40.000000000","message":"in a multi-threaded keystone this will start exploding all over the place if they config with multiple sql backends in separate threads.","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        domain_config[\u0027cfg_overrides\u0027] \u003d specific_config"},{"line_number":192,"context_line":"        domain_config[\u0027driver\u0027] \u003d self._load_driver(domain_config)"},{"line_number":193,"context_line":"        self._assert_no_more_than_one_sql_driver(domain_id, domain_config)"},{"line_number":194,"context_line":"        self[domain_id] \u003d domain_config"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _setup_domain_drivers_from_database(self, standard_driver,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_63b4daf1","line":193,"in_reply_to":"da9b358b_09209b9a","updated":"2015-03-30 11:18:32.000000000","message":"So the issue you are raising here is two creates (or updates) being processed in separate threads would expose the time window between the check in this method and setting self._any_sql ?","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                                                  resource_api)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def get_domain_driver(self, domain_id):"},{"line_number":230,"context_line":"        self.check_config_and_reload_domain_driver_if_requried(domain_id)"},{"line_number":231,"context_line":"        if domain_id in self:"},{"line_number":232,"context_line":"            return self[domain_id][\u0027driver\u0027]"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_7e2fdfa1","line":230,"updated":"2015-03-30 00:12:40.000000000","message":"change \"requried\" to \"required\"","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                                                  resource_api)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def get_domain_driver(self, domain_id):"},{"line_number":230,"context_line":"        self.check_config_and_reload_domain_driver_if_requried(domain_id)"},{"line_number":231,"context_line":"        if domain_id in self:"},{"line_number":232,"context_line":"            return self[domain_id][\u0027driver\u0027]"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_bd7e83ac","line":230,"in_reply_to":"da9b358b_7e2fdfa1","updated":"2015-03-30 11:18:32.000000000","message":"Done","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        will get any config that has been updated from any other keystone"},{"line_number":267,"context_line":"        process."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        This cache-timeout approach should work both in multi-process and"},{"line_number":270,"context_line":"        multi-threaded keystone configurations. In multi-threaded"},{"line_number":271,"context_line":"        configurations, even though we might remove a driver object (that"},{"line_number":272,"context_line":"        could be in use by another thread), this won\u0027t actually be thrown away"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_1e1d7373","line":269,"updated":"2015-03-30 00:12:40.000000000","message":"\"should\"? it either works or it doesn\u0027t.","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        will get any config that has been updated from any other keystone"},{"line_number":267,"context_line":"        process."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        This cache-timeout approach should work both in multi-process and"},{"line_number":270,"context_line":"        multi-threaded keystone configurations. In multi-threaded"},{"line_number":271,"context_line":"        configurations, even though we might remove a driver object (that"},{"line_number":272,"context_line":"        could be in use by another thread), this won\u0027t actually be thrown away"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_bd03230f","line":269,"in_reply_to":"da9b358b_1e1d7373","updated":"2015-03-30 11:18:32.000000000","message":"Done","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        could be in use by another thread), this won\u0027t actually be thrown away"},{"line_number":273,"context_line":"        until all references to it have been broken. When that other"},{"line_number":274,"context_line":"        thread is released back and is restarted with another command to"},{"line_number":275,"context_line":"        process, next time it comes to access the driver it will pickup"},{"line_number":276,"context_line":"        the new one."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_de16eb54","line":275,"updated":"2015-03-30 00:12:40.000000000","message":"chnage \"comes to access\" to \"accesses\"","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        could be in use by another thread), this won\u0027t actually be thrown away"},{"line_number":273,"context_line":"        until all references to it have been broken. When that other"},{"line_number":274,"context_line":"        thread is released back and is restarted with another command to"},{"line_number":275,"context_line":"        process, next time it comes to access the driver it will pickup"},{"line_number":276,"context_line":"        the new one."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_a0ff7800","line":275,"in_reply_to":"da9b358b_de16eb54","updated":"2015-03-30 11:18:32.000000000","message":"Done","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        latest_domain_config \u003d ("},{"line_number":288,"context_line":"            self.domain_config_api."},{"line_number":289,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":290,"context_line":"        domain_config_in_use \u003d domain_id in self"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        if latest_domain_config:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_09577b03","line":289,"updated":"2015-03-30 00:12:40.000000000","message":"one thread is writing domain config and another thread is reading it... how is this thread-safe?","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        latest_domain_config \u003d ("},{"line_number":288,"context_line":"            self.domain_config_api."},{"line_number":289,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":290,"context_line":"        domain_config_in_use \u003d domain_id in self"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        if latest_domain_config:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_a33782af","line":289,"in_reply_to":"da9b358b_09577b03","updated":"2015-03-30 11:18:32.000000000","message":"So I *think* the point you are making is that get/create/update/delete domain configs are not atomic, hence a collision of, say, an get and create/update might return you a partial config?  That point is valid, although not actually an issue with this patch, more the core domain config update mechanisms. If that is the issue, I will raise a defect on those, rather than try and fix it here.","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"1250b7fab02a8aa7906234ecd445dcb1435aae87","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                self._load_config_from_database(domain_id,"},{"line_number":296,"context_line":"                                                latest_domain_config)"},{"line_number":297,"context_line":"        elif domain_config_in_use:"},{"line_number":298,"context_line":"            del self[domain_id]"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_e90d7738","line":298,"updated":"2015-03-30 00:12:40.000000000","message":"there should also be an explanation what\u0027s going on in the \"else:\" leg here.","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"c325104815462d0d1bbdd6853b877a1a33e120e4","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                self._load_config_from_database(domain_id,"},{"line_number":296,"context_line":"                                                latest_domain_config)"},{"line_number":297,"context_line":"        elif domain_config_in_use:"},{"line_number":298,"context_line":"            del self[domain_id]"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da9b358b_20b00843","line":298,"in_reply_to":"da9b358b_e90d7738","updated":"2015-03-30 11:18:32.000000000","message":"Done","commit_id":"daa7e734be6863742835cf747d7e77cd0c5fea88"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8906e12b69208b92b0d088af0cbf2c6e6a73261e","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        domain_config[\u0027cfg_overrides\u0027] \u003d specific_config"},{"line_number":192,"context_line":"        domain_config[\u0027driver\u0027] \u003d self._load_driver(domain_config)"},{"line_number":193,"context_line":"        self._assert_no_more_than_one_sql_driver(domain_id, domain_config)"},{"line_number":194,"context_line":"        self[domain_id] \u003d domain_config"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _setup_domain_drivers_from_database(self, standard_driver,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_b9f9d782","line":193,"updated":"2015-03-31 00:34:01.000000000","message":"in a multi-threaded keystone this will start exploding all over the place if they config with multiple sql backends in separate threads -- essentially you have one thread creates an sql backend and another thread creates an sql backend at the same time. They\u0027re both successful because to both of them there was only one sql driver. But everything fails afterwards because there\u0027s 2.","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"bdcdc7bf1cd711e3ae1385e853c5be81e9d26bf4","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        domain_config[\u0027cfg_overrides\u0027] \u003d specific_config"},{"line_number":192,"context_line":"        domain_config[\u0027driver\u0027] \u003d self._load_driver(domain_config)"},{"line_number":193,"context_line":"        self._assert_no_more_than_one_sql_driver(domain_id, domain_config)"},{"line_number":194,"context_line":"        self[domain_id] \u003d domain_config"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _setup_domain_drivers_from_database(self, standard_driver,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_46c40d5e","line":193,"in_reply_to":"da9b358b_a697598f","updated":"2015-03-31 14:39:44.000000000","message":"An alternative solution would be that a per-domain driver cannot be sql, if someone wants to override the default domain to use ldap, use a per-domain driver for ldap for the default domain. \n\nI am not sure there is a real benefit to using sql for one domain separate from a non-domain aware ldap default driver.","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"1d23f5d881cdaf2c707fd13471a57ec004f50443","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        domain_config[\u0027cfg_overrides\u0027] \u003d specific_config"},{"line_number":192,"context_line":"        domain_config[\u0027driver\u0027] \u003d self._load_driver(domain_config)"},{"line_number":193,"context_line":"        self._assert_no_more_than_one_sql_driver(domain_id, domain_config)"},{"line_number":194,"context_line":"        self[domain_id] \u003d domain_config"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def _setup_domain_drivers_from_database(self, standard_driver,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_a697598f","line":193,"in_reply_to":"da9b358b_b9f9d782","updated":"2015-03-31 14:36:23.000000000","message":"The solution here is to have some kind of constraint that prevents multiples from being configured (enforced at the db level) or similar. \n\nThe whole reload drivers in a multi-threaded environment is a challenge in itself and has a lot of these types of edge cases.","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8906e12b69208b92b0d088af0cbf2c6e6a73261e","unresolved":false,"context_lines":[{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        latest_domain_config \u003d ("},{"line_number":287,"context_line":"            self.domain_config_api."},{"line_number":288,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":289,"context_line":"        domain_config_in_use \u003d domain_id in self"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        if latest_domain_config:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_b940b7a6","line":288,"updated":"2015-03-31 00:34:01.000000000","message":"yes, it\u0027s not thread-safe, so raise an issue.","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"4571e459bf02575f06c2c4fd31360ef2f5181d76","unresolved":false,"context_lines":[{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        latest_domain_config \u003d ("},{"line_number":287,"context_line":"            self.domain_config_api."},{"line_number":288,"context_line":"            get_config_with_sensitive_info(domain_id))"},{"line_number":289,"context_line":"        domain_config_in_use \u003d domain_id in self"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        if latest_domain_config:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_d35b41f5","line":288,"in_reply_to":"da9b358b_b940b7a6","updated":"2015-03-31 14:22:32.000000000","message":"Done","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8906e12b69208b92b0d088af0cbf2c6e6a73261e","unresolved":false,"context_lines":[{"line_number":296,"context_line":"        elif domain_config_in_use:"},{"line_number":297,"context_line":"            # The domain specific config has been deleted, so should remove the"},{"line_number":298,"context_line":"            # specific driver for this domain"},{"line_number":299,"context_line":"            del self[domain_id]"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":8,"id":"da9b358b_191683a7","line":299,"updated":"2015-03-31 00:34:01.000000000","message":"there should also be an explanation what\u0027s going on in the implicit \"else:\" leg here... there\u0027s no domain config and domain config isn\u0027t in use... how did this happen? Probably should log a debug so that I have some idea what\u0027s going on when this happens on a customer\u0027s system.","commit_id":"07be4cd446c6dd63e06410bf6b9c962a47ce6bc5"},{"author":{"_account_id":9142,"name":"Samuel de Medeiros Queiroz","email":"samueldmq@lsd.ufcg.edu.br","username":"samuel-z","inactive":true},"change_message_id":"b501a4e7fc435cd9370d4f3c4d10763c7b81d69e","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        elif domain_config_in_use:"},{"line_number":312,"context_line":"            # The domain specific config has been deleted, so should remove the"},{"line_number":313,"context_line":"            # specific driver for this domain"},{"line_number":314,"context_line":"            del self[domain_id]"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa041b7_e01c8279","line":314,"updated":"2015-04-01 13:45:39.000000000","message":"I am not sure \u0027del self[domain_id]\u0027 is correct for a multithread env.\nSuppose multiple threads call get_domain_driver for the same domain_id and they get in this elif. The first one will execute \u0027del self[domain_id]\u0027 succesfully, however the others will fail, since domain_id will be an inexistent key.\n\nMaybe we should change this to \u0027delattr(self, domain_id, None)\u0027, which should not fail if the key is not found.\n\n\n---\n\nAlso, we need a test case for this, in which i) the domain driver is loaded and we do get_domain_driver(domain_id) ii) its config is deleted and iii) trying get_domain_driver(domain_id) again returns None. Makes sense?","commit_id":"eaa1113cf0fd487c886efe92364b576e4795fc39"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"7ffe92920d791ec1a7b3a98cfbaf7bef37e8833e","unresolved":false,"context_lines":[{"line_number":311,"context_line":"        elif domain_config_in_use:"},{"line_number":312,"context_line":"            # The domain specific config has been deleted, so should remove the"},{"line_number":313,"context_line":"            # specific driver for this domain"},{"line_number":314,"context_line":"            del self[domain_id]"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"def domains_configured(f):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa041b7_154d5e72","line":314,"in_reply_to":"baa041b7_e01c8279","updated":"2015-04-01 15:52:26.000000000","message":"So have put the del in a try block to achieve the same affect.  There is no test for this bit right now, I\u0027ll see if I can add one.","commit_id":"eaa1113cf0fd487c886efe92364b576e4795fc39"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"05c7c7f93c831bb840193484d56418d36f90683f","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            # specific driver for this domain."},{"line_number":314,"context_line":"            try:"},{"line_number":315,"context_line":"                del self[domain_id]"},{"line_number":316,"context_line":"            except AttributeError:"},{"line_number":317,"context_line":"                # Allow this error in case we are unlucky and in a"},{"line_number":318,"context_line":"                # multi-threaded situation, two threads happen to be running"},{"line_number":319,"context_line":"                # in lock step."}],"source_content_type":"text/x-python","patch_set":10,"id":"baa041b7_d923a204","line":316,"updated":"2015-04-02 00:57:17.000000000","message":"Should this be KeyError?","commit_id":"ca96e28669ccf5ccf54ede8b7c6a135ade39d865"},{"author":{"_account_id":5707,"name":"Henry Nash","email":"henryn@linux.vnet.ibm.com","username":"henry-nash"},"change_message_id":"dca7f51ed1f4acc2a11a0e326bf0f90188d5650c","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            # specific driver for this domain."},{"line_number":314,"context_line":"            try:"},{"line_number":315,"context_line":"                del self[domain_id]"},{"line_number":316,"context_line":"            except AttributeError:"},{"line_number":317,"context_line":"                # Allow this error in case we are unlucky and in a"},{"line_number":318,"context_line":"                # multi-threaded situation, two threads happen to be running"},{"line_number":319,"context_line":"                # in lock step."}],"source_content_type":"text/x-python","patch_set":10,"id":"baa041b7_9ec85876","line":316,"in_reply_to":"baa041b7_19d6aac5","updated":"2015-04-02 06:29:36.000000000","message":"yep, you\u0027re right.  Fixed.","commit_id":"ca96e28669ccf5ccf54ede8b7c6a135ade39d865"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"7485f4bf3437db56ddf1c0faa5fcc571334d695f","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            # specific driver for this domain."},{"line_number":314,"context_line":"            try:"},{"line_number":315,"context_line":"                del self[domain_id]"},{"line_number":316,"context_line":"            except AttributeError:"},{"line_number":317,"context_line":"                # Allow this error in case we are unlucky and in a"},{"line_number":318,"context_line":"                # multi-threaded situation, two threads happen to be running"},{"line_number":319,"context_line":"                # in lock step."}],"source_content_type":"text/x-python","patch_set":10,"id":"baa041b7_19d6aac5","line":316,"in_reply_to":"baa041b7_d923a204","updated":"2015-04-02 01:00:18.000000000","message":"good catch, should be a KeyError","commit_id":"ca96e28669ccf5ccf54ede8b7c6a135ade39d865"}]}
