)]}'
{"ceilometer/alarm/storage/pymongo_base.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"f26bcddfd923d0770a5479fff5490df4a2480f22","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        while True:"},{"line_number":194,"context_line":"            try:"},{"line_number":195,"context_line":"                if limit is not None:"},{"line_number":196,"context_line":"                    alarms \u003d list(self.db.alarm.find(query_filter,"},{"line_number":197,"context_line":"                                                     limit\u003dlimit,"},{"line_number":198,"context_line":"                                                     sort\u003dorderby))"},{"line_number":199,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_de11ad54","line":196,"updated":"2014-09-18 11:18:11.000000000","message":"Perhaps adding a helper method like:\n\n    def retry_on_autoreconnect(method, *args, **kwargs):\n          while True:\n              try:\n                  return method(*args, **kwargs)\n              except pymongo.errors.AutoReconnect:\n                  time.sleep(1)\n              else:\n                  break;\n\nand then: \n     \n     alarms \u003d retry_on_autoreconnect(self.db.alarm.find, query_filter, ....)\n\nwill reduce the among of code to do that.\n\n\nAlso I\u0027m not sure about retrying for ever, I think we need a timeout or something like that.","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                else:"},{"line_number":200,"context_line":"                    alarms \u003d list(self.db.alarm.find(query_filter,"},{"line_number":201,"context_line":"                                                     sort\u003dorderby))"},{"line_number":202,"context_line":"            except pymongo.errors.AutoReconnect:"},{"line_number":203,"context_line":"                time.sleep(1)"},{"line_number":204,"context_line":"            else:"},{"line_number":205,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_7391da45","line":202,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                else:"},{"line_number":222,"context_line":"                    alarms_history \u003d list(self.db.alarm_history.find("},{"line_number":223,"context_line":"                        query_filter, sort\u003dorderby))"},{"line_number":224,"context_line":"            except pymongo.errors.AutoReconnect:"},{"line_number":225,"context_line":"                time.sleep(1)"},{"line_number":226,"context_line":"            else:"},{"line_number":227,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_53a056a5","line":224,"updated":"2014-09-18 11:07:57.000000000","message":"I guess we need here some configurable number of reconnects here, otherwise it might be endless process if something went wrong with Mongo - I guess this exception is too wide and might fall from different places and different situations .","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"}],"ceilometer/storage/__init__.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"4455825a0a5a748efc33f04e18f79dd11f0861df","unresolved":false,"context_lines":[{"line_number":53,"context_line":"               default\u003dNone,"},{"line_number":54,"context_line":"               help\u003d\u0027The connection string used to connect to the alarm \u0027"},{"line_number":55,"context_line":"               \u0027database. (if unset, connection is used)\u0027),"},{"line_number":56,"context_line":"    cfg.BoolOpt(\u0027replica_set\u0027,"},{"line_number":57,"context_line":"                default\u003dFalse,"},{"line_number":58,"context_line":"                help\u003d\"The connection boolean variable, should to be set \u0027True\u0027\""},{"line_number":59,"context_line":"                     \" if we use database in replica set.\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_cd785e2e","line":56,"updated":"2014-09-29 12:22:44.000000000","message":"These new variables seem mongodb-specific.\n\nIIRC in oslo.db, the convention \u003cdb\u003e_option_name is used for DB-specific options.\n\nHow about renaming to mongodb_replica_set?\n\nAlso would it be clearer to just have a single variable, e.g.:\n\n  mongodb_replica_set \u003d\u003d \"foobar\" \u003d\u003d\u003e connect to replicaset foobar\n\n  mongodb_replica_set \u003d\u003d None \u003d\u003d\u003e do not used replica set style connection","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"5b952e0bb45a1cb5cfbf51a51f8b7d46dd498be4","unresolved":false,"context_lines":[{"line_number":53,"context_line":"               default\u003dNone,"},{"line_number":54,"context_line":"               help\u003d\u0027The connection string used to connect to the alarm \u0027"},{"line_number":55,"context_line":"               \u0027database. (if unset, connection is used)\u0027),"},{"line_number":56,"context_line":"    cfg.BoolOpt(\u0027replica_set\u0027,"},{"line_number":57,"context_line":"                default\u003dFalse,"},{"line_number":58,"context_line":"                help\u003d\"The connection boolean variable, should to be set \u0027True\u0027\""},{"line_number":59,"context_line":"                     \" if we use database in replica set.\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_4d362e05","line":56,"in_reply_to":"baa201ad_cd785e2e","updated":"2014-09-29 13:03:22.000000000","message":"Yes, sure. I will improve this.","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":12119,"name":"Can ZHANG","email":"zhangcan@letv.com","username":"can_zhang"},"change_message_id":"af801f30f836f37664de211eed3748c2c640ac34","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    cfg.StrOpt(\u0027mongodb_replica_set\u0027,"},{"line_number":62,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":63,"context_line":"               help\u003d\"The connection string used to connect to mongo database, \""},{"line_number":64,"context_line":"                    \"if mongodb replica set was chosen.\"),"},{"line_number":65,"context_line":"]"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"cfg.CONF.register_opts(OPTS, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a8c0949_7230be01","line":64,"updated":"2014-11-07 04:01:55.000000000","message":"I think this should be the name of the replica set. Not the connection string. ref: http://api.mongodb.org/python/current/examples/high_availability.html#mongoreplicasetclient","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"9613bacff02690c2343ec1c0020f4c532642f712","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    cfg.StrOpt(\u0027mongodb_replica_set\u0027,"},{"line_number":62,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":63,"context_line":"               help\u003d\"The connection string used to connect to mongo database, \""},{"line_number":64,"context_line":"                    \"if mongodb replica set was chosen.\"),"},{"line_number":65,"context_line":"]"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"cfg.CONF.register_opts(OPTS, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a8c0949_ad4e476d","line":64,"in_reply_to":"7a8c0949_7230be01","updated":"2014-11-07 04:31:08.000000000","message":"there already has a fix, see: https://review.openstack.org/#/c/132525/","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"},{"author":{"_account_id":12119,"name":"Can ZHANG","email":"zhangcan@letv.com","username":"can_zhang"},"change_message_id":"dd8b4a155002dfac06519e447cc515a422b1cbcf","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    cfg.StrOpt(\u0027mongodb_replica_set\u0027,"},{"line_number":62,"context_line":"               default\u003d\u0027\u0027,"},{"line_number":63,"context_line":"               help\u003d\"The connection string used to connect to mongo database, \""},{"line_number":64,"context_line":"                    \"if mongodb replica set was chosen.\"),"},{"line_number":65,"context_line":"]"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"cfg.CONF.register_opts(OPTS, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a8c0949_8ded0bf2","line":64,"in_reply_to":"7a8c0949_ad4e476d","updated":"2014-11-07 06:13:53.000000000","message":"Nice!","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"}],"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            return"},{"line_number":564,"context_line":"        if not marker_pairs:"},{"line_number":565,"context_line":"            return"},{"line_number":566,"context_line":"        while True:"},{"line_number":567,"context_line":"            try:"},{"line_number":568,"context_line":"                ret \u003d list(db_collection.find(marker_pairs, limit\u003d2))"},{"line_number":569,"context_line":"            except pymongo.errors.AutoReconnect:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_33a752a9","line":566,"updated":"2014-09-18 11:07:57.000000000","message":"actually the same problem I\u0027ve described in previous file","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":736,"context_line":"                                 query\u003dquery)"},{"line_number":737,"context_line":""},{"line_number":738,"context_line":"        try:"},{"line_number":739,"context_line":"            while True:"},{"line_number":740,"context_line":"                try:"},{"line_number":741,"context_line":"                    resources \u003d list(self.db[out].find(sort\u003dsort_instructions))"},{"line_number":742,"context_line":"                except pymongo.errors.AutoReconnect:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_73b8fac7","line":739,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":775,"context_line":"                     for i in keys]"},{"line_number":776,"context_line":"        sort_instructions \u003d self._build_sort_instructions(sort_keys)[0]"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        while True:"},{"line_number":779,"context_line":"            try:"},{"line_number":780,"context_line":"                resources \u003d list(self.db.resource.find("},{"line_number":781,"context_line":"                    query, sort\u003dsort_instructions))"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_b3b262e3","line":778,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"}],"ceilometer/storage/mongo/utils.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"8b1dc9de92c924296605c5d4d849484c16b52ff3","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        try:"},{"line_number":332,"context_line":"            return list(method(*args, **kwargs))"},{"line_number":333,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":334,"context_line":"            if 0 \u003c\u003d max_retries \u003c\u003d attempts:"},{"line_number":335,"context_line":"                LOG.error(_(\u0027Unable to reconnect to the primary mongodb after \u0027"},{"line_number":336,"context_line":"                            \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":337,"context_line":"                          {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_af757533","line":334,"range":{"start_line":334,"start_character":20,"end_line":334,"end_character":31},"updated":"2014-09-19 10:17:14.000000000","message":"what would happen here if max_retries is set to the negative in conf? (it\u0027s int opt, so theoretically it might be)\n\nI\u0027ll propose to change this like to the following:\n\nif attempts \u003e max_retries:\n   ...","commit_id":"6ae83892bd16fd29cfb0048891f7a202ddcb92c0"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"9a4c5477caf1831a3da741bf73aaaf8fd6c56c55","unresolved":false,"context_lines":[{"line_number":331,"context_line":"        try:"},{"line_number":332,"context_line":"            return list(method(*args, **kwargs))"},{"line_number":333,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":334,"context_line":"            if 0 \u003c\u003d max_retries \u003c\u003d attempts:"},{"line_number":335,"context_line":"                LOG.error(_(\u0027Unable to reconnect to the primary mongodb after \u0027"},{"line_number":336,"context_line":"                            \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":337,"context_line":"                          {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_e0eb0ada","line":334,"updated":"2014-09-19 12:44:25.000000000","message":"I guess this should be fixed here as well","commit_id":"ece45e119527c5867e5bd323075dd65829bffd44"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"4455825a0a5a748efc33f04e18f79dd11f0861df","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                if cfg.CONF.database.replica_set:"},{"line_number":188,"context_line":"                    db_replica_name \u003d cfg.CONF.database.db_replica_name"},{"line_number":189,"context_line":"                    client \u003d MongoProxy(pymongo.MongoReplicaSetClient("},{"line_number":190,"context_line":"                        url, replicaSet\u003ddb_replica_name))"},{"line_number":191,"context_line":"                else:"},{"line_number":192,"context_line":"                    client \u003d MongoProxy(pymongo.MongoClient(url, safe\u003dTrue))"},{"line_number":193,"context_line":"            except pymongo.errors.ConnectionFailure as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_8d1496f6","line":190,"updated":"2014-09-29 12:22:44.000000000","message":"I\u0027m confused by this logic to create the MongoReplicaSetClient if the replica_set config is provided. Wouldn\u0027t that bypass the AutoReconnect-handling logic set up by the proxy?","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"34bade0f69b61f611e0ccae50f10e597d558c601","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                if cfg.CONF.database.replica_set:"},{"line_number":188,"context_line":"                    db_replica_name \u003d cfg.CONF.database.db_replica_name"},{"line_number":189,"context_line":"                    client \u003d MongoProxy(pymongo.MongoReplicaSetClient("},{"line_number":190,"context_line":"                        url, replicaSet\u003ddb_replica_name))"},{"line_number":191,"context_line":"                else:"},{"line_number":192,"context_line":"                    client \u003d MongoProxy(pymongo.MongoClient(url, safe\u003dTrue))"},{"line_number":193,"context_line":"            except pymongo.errors.ConnectionFailure as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_e11d1075","line":190,"in_reply_to":"baa201ad_3005bdc2","updated":"2014-09-30 10:26:31.000000000","message":"Yeah, AFAICS the AutoReconnect is also raised by the replicaset-aware MongoReplicaSetClient as well as the standard MongoClient, but from a slightly different codepath.\n\nSo it may not be an issue at all, if the AutoReconnect is raised in the same circumstances by both versions of the client.\n\nTBH I was expecting MongoReplicaSetClient to be more directly aware of the replicaset state (i.e. to know about each replica and its primary versus secondary status, failovers in progress, etc).\n\nHence my thought that the AutoReconnect-raising logic might not be as explicit for MongoReplicaSetClient (i.e. that it might not expose that exception to the application logic in all circumstances).","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"5b952e0bb45a1cb5cfbf51a51f8b7d46dd498be4","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                if cfg.CONF.database.replica_set:"},{"line_number":188,"context_line":"                    db_replica_name \u003d cfg.CONF.database.db_replica_name"},{"line_number":189,"context_line":"                    client \u003d MongoProxy(pymongo.MongoReplicaSetClient("},{"line_number":190,"context_line":"                        url, replicaSet\u003ddb_replica_name))"},{"line_number":191,"context_line":"                else:"},{"line_number":192,"context_line":"                    client \u003d MongoProxy(pymongo.MongoClient(url, safe\u003dTrue))"},{"line_number":193,"context_line":"            except pymongo.errors.ConnectionFailure as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_3005bdc2","line":190,"in_reply_to":"baa201ad_8d1496f6","updated":"2014-09-29 13:03:22.000000000","message":"I thought that connection part is the best place to decide what client MongoClient or MongoReplicaSetClient should be created. I have add some little changes to this method. Probably I have missed some simple solution, I will appreciate any help with it.","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"51cf32e109410a2832d818bb98a192f8b90204fa","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                if cfg.CONF.database.replica_set:"},{"line_number":188,"context_line":"                    db_replica_name \u003d cfg.CONF.database.db_replica_name"},{"line_number":189,"context_line":"                    client \u003d MongoProxy(pymongo.MongoReplicaSetClient("},{"line_number":190,"context_line":"                        url, replicaSet\u003ddb_replica_name))"},{"line_number":191,"context_line":"                else:"},{"line_number":192,"context_line":"                    client \u003d MongoProxy(pymongo.MongoClient(url, safe\u003dTrue))"},{"line_number":193,"context_line":"            except pymongo.errors.ConnectionFailure as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_694bc6b0","line":190,"in_reply_to":"baa201ad_e11d1075","updated":"2014-09-30 12:35:12.000000000","message":"As far as I have investigate the main difference of the clients is that for replicaset client you don\u0027t need to set all hosts connections but only one and configure name of our replicaset mongo. For standard MongoClient if someone use it with replica set it is needed to set all hosts in mongo url. But AutoReconnect is raised in the same circumstance. \n\nSo it seems that for simple configuration of ceilometer with MongoReplicaSet it is useful to create MongoReplicaSetClient.","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"4455825a0a5a748efc33f04e18f79dd11f0861df","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            # We need this additional branch because in Mongo method \"find\""},{"line_number":362,"context_line":"            # returns an iterator and it doesn\u0027t connect to the db while"},{"line_number":363,"context_line":"            # calling. So without converting iterator to list we cannot"},{"line_number":364,"context_line":"            # catch AutoReconnect exception."},{"line_number":365,"context_line":"            return list(self.method(*args, **kwargs))"},{"line_number":366,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":367,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_cd9f7e4f","line":364,"updated":"2014-09-29 12:22:44.000000000","message":"Do you need to unwind this potentially very long list?\n\nWould it suffice to just grab the first item, and then recombine back with the \"remainder\" of the iterator?","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"d041465762f31b039c4c58f12c1563851a58e743","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            # We need this additional branch because in Mongo method \"find\""},{"line_number":362,"context_line":"            # returns an iterator and it doesn\u0027t connect to the db while"},{"line_number":363,"context_line":"            # calling. So without converting iterator to list we cannot"},{"line_number":364,"context_line":"            # catch AutoReconnect exception."},{"line_number":365,"context_line":"            return list(self.method(*args, **kwargs))"},{"line_number":366,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":367,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_eb5a6a4f","line":364,"in_reply_to":"baa201ad_507ec1e5","updated":"2014-09-29 13:41:49.000000000","message":"but this means that in case of list we\u0027ll need to store all the info in memory! that\u0027s not the thing we\u0027d love to see for sure, as it might be hundreds of GBs... Personally I think better we\u0027ll lose some data, but will keep node safe, so agree with Eoghan","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"5b952e0bb45a1cb5cfbf51a51f8b7d46dd498be4","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            # We need this additional branch because in Mongo method \"find\""},{"line_number":362,"context_line":"            # returns an iterator and it doesn\u0027t connect to the db while"},{"line_number":363,"context_line":"            # calling. So without converting iterator to list we cannot"},{"line_number":364,"context_line":"            # catch AutoReconnect exception."},{"line_number":365,"context_line":"            return list(self.method(*args, **kwargs))"},{"line_number":366,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":367,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_507ec1e5","line":364,"in_reply_to":"baa201ad_cd9f7e4f","updated":"2014-09-29 13:03:22.000000000","message":"Unfortunately it wouldn\u0027t suffice to grab the first item, imagine what would happened if ceilo lost connection on n-th item where n !\u003d 1. For read operations it seems that list is better then iterator.","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"51cf32e109410a2832d818bb98a192f8b90204fa","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            # We need this additional branch because in Mongo method \"find\""},{"line_number":362,"context_line":"            # returns an iterator and it doesn\u0027t connect to the db while"},{"line_number":363,"context_line":"            # calling. So without converting iterator to list we cannot"},{"line_number":364,"context_line":"            # catch AutoReconnect exception."},{"line_number":365,"context_line":"            return list(self.method(*args, **kwargs))"},{"line_number":366,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":367,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_49db621b","line":364,"in_reply_to":"baa201ad_eb5a6a4f","updated":"2014-09-30 12:35:12.000000000","message":"Done.","commit_id":"cf709950e9179ee53fb70e5651016c781a043e1b"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"fd6a7058108d6f317414b207861a8c2ba4cb07ec","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            # returns an iterator and it doesn\u0027t connect to the db while"},{"line_number":362,"context_line":"            # calling."},{"line_number":363,"context_line":"            self.method(*args, **kwargs).next()"},{"line_number":364,"context_line":"            return self.method(*args, **kwargs)"},{"line_number":365,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"MONGO_METHODS \u003d set([typ for typ in dir(pymongo.collection.Collection)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa201ad_45df4c0d","line":364,"updated":"2014-10-06 12:55:21.000000000","message":"I\u0027m confused about this approach, calling the method twice in the case of find.\n\nSurely this is sub-optimal for each query to hit the DB twice, after discarding the first found element the first time round? \n\nWould it be better to hit the DB method only once, keep the returned iterator, peek at the first element and then recombine this element with the remainder of the iterator before returning.","commit_id":"ca0d2dbfca8d45e81d65ada821bddd0e078dcdd4"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"2fb5e8246e8463bda4a828d81df0123dd53a39a6","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                return itertools.chain([first], found)"},{"line_number":368,"context_line":"            except StopIteration:"},{"line_number":369,"context_line":"                LOG.warn(_(\u0027Unable to return an empty iterator from the \u0027"},{"line_number":370,"context_line":"                           \u0027database.\u0027))"},{"line_number":371,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"MONGO_METHODS \u003d set([typ for typ in dir(pymongo.collection.Collection)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa201ad_18e67415","line":370,"updated":"2014-10-07 07:28:43.000000000","message":"I don\u0027t understand this warning on StopIteration, surely the find matching nothing in the DB should just return an empty iterator?\n\nAlso why in that case do you then proceed to line 371 and call out to the DB method a second time?\n\nHow about structuring it like this:\n\n    if self.method.__name__.endswith(\u0027find\u0027):\n        try:\n            found \u003d self.method(*args, **kwargs)\n            first \u003d found.next()\n            return itertools.chain([first], found)\n        except StopIteration:\n            return iter([])\n    return self.method(*args, **kwargs)\n\nThis line of reasoning emphasizes the lack of tests in the patch. How about adding a unit test that patches out the MongoClient and MongoRelicaSetClient with mocks, and includes the following assertions:\n\n* MongoClient is used if CONF.database.mongodb_replica_set is set, MongoRelicaSetClient\n* all used DB methods (find, find_and_modify, insert, map_reduce) are retried on AutoReconnect\n* if say find returns an iterator with multiple items, the initial item is not dropped and the DB is not hit a second time\n* if say find returns an empty iterator, then the DB is not hit a second time","commit_id":"818597c8f095916aa7a77b1bce85a837b7c53982"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"1e80e456f5f239730257f7db1ed8bd6c2769cb30","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                return itertools.chain([first], found)"},{"line_number":368,"context_line":"            except StopIteration:"},{"line_number":369,"context_line":"                LOG.warn(_(\u0027Unable to return an empty iterator from the \u0027"},{"line_number":370,"context_line":"                           \u0027database.\u0027))"},{"line_number":371,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"MONGO_METHODS \u003d set([typ for typ in dir(pymongo.collection.Collection)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa201ad_78f06067","line":370,"in_reply_to":"baa201ad_18e67415","updated":"2014-10-07 07:51:29.000000000","message":"Eoghan thank you for your care with my patch! :) I agree that I handled exception in a strange way. Will use your advise. And will add unit tests for cases that you have mentioned.","commit_id":"818597c8f095916aa7a77b1bce85a837b7c53982"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"6f2313e9183a791bf352f04161bf6bec81afa189","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                return itertools.chain([first], found)"},{"line_number":368,"context_line":"            except StopIteration:"},{"line_number":369,"context_line":"                LOG.warn(_(\u0027Unable to return an empty iterator from the \u0027"},{"line_number":370,"context_line":"                           \u0027database.\u0027))"},{"line_number":371,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"MONGO_METHODS \u003d set([typ for typ in dir(pymongo.collection.Collection)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa201ad_f8b1b08f","line":370,"in_reply_to":"baa201ad_18e67415","updated":"2014-10-07 07:56:08.000000000","message":"Thanks!\n\nBTW I just realized I butchered the above comment:\n\n\"MongoClient is used if CONF.database.mongodb_replica_set is set, MongoRelicaSetClient\"\n\nshould read as:\n\nMongoClient is used if CONF.database.mongodb_replica_set is *not* set, otherwsie MongoRelicaSetClient","commit_id":"818597c8f095916aa7a77b1bce85a837b7c53982"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"6a46859b7359fc5e0a11cde83fe0d005a0acbd72","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                return itertools.chain([first], found)"},{"line_number":368,"context_line":"            except StopIteration:"},{"line_number":369,"context_line":"                LOG.warn(_(\u0027Unable to return an empty iterator from the \u0027"},{"line_number":370,"context_line":"                           \u0027database.\u0027))"},{"line_number":371,"context_line":"        return self.method(*args, **kwargs)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"MONGO_METHODS \u003d set([typ for typ in dir(pymongo.collection.Collection)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baa201ad_38041817","line":370,"in_reply_to":"baa201ad_f8b1b08f","updated":"2014-10-07 08:00:48.000000000","message":"I got what you meant. :) Writing tests now.","commit_id":"818597c8f095916aa7a77b1bce85a837b7c53982"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"53f62a37c330aac43ee0565427c85e2eb17685bd","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def __getattr__(self, item):"},{"line_number":384,"context_line":"        \"\"\"Wrap MongoDB connection."},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        If item is the name of an executable method for instance find or"},{"line_number":387,"context_line":"        insert, wrap this method in the MongoConn."},{"line_number":388,"context_line":"        Else call __getitem__(item)."},{"line_number":389,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_f45c627f","line":386,"range":{"start_line":386,"start_character":45,"end_line":386,"end_character":51},"updated":"2014-10-16 09:15:43.000000000","message":"comma after the \"method\"","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"11b9a17ec63a3dfe3bc553d4b44e41b3e9100ee8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def __getattr__(self, item):"},{"line_number":384,"context_line":"        \"\"\"Wrap MongoDB connection."},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        If item is the name of an executable method for instance find or"},{"line_number":387,"context_line":"        insert, wrap this method in the MongoConn."},{"line_number":388,"context_line":"        Else call __getitem__(item)."},{"line_number":389,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_547e0eb0","line":386,"range":{"start_line":386,"start_character":45,"end_line":386,"end_character":51},"in_reply_to":"baa201ad_f45c627f","updated":"2014-10-16 09:22:59.000000000","message":"It seems that comma should be after instance. Done.","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"53f62a37c330aac43ee0565427c85e2eb17685bd","unresolved":false,"context_lines":[{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def find(self, *args, **kwargs):"},{"line_number":405,"context_line":"        # We need this modifying method to check a connection for MongoDB"},{"line_number":406,"context_line":"        # in frame of MongoProxy approach. Initially \u0027find\u0027 return Cursor"},{"line_number":407,"context_line":"        # object and doesn\u0027t connect to db while Cursor is not used."},{"line_number":408,"context_line":"        found \u003d self.find(*args, **kwargs)"},{"line_number":409,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_54744efd","line":406,"range":{"start_line":406,"start_character":13,"end_line":406,"end_character":18},"updated":"2014-10-16 09:15:43.000000000","message":"frame -\u003e context, return -\u003e returns","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"11b9a17ec63a3dfe3bc553d4b44e41b3e9100ee8","unresolved":false,"context_lines":[{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    def find(self, *args, **kwargs):"},{"line_number":405,"context_line":"        # We need this modifying method to check a connection for MongoDB"},{"line_number":406,"context_line":"        # in frame of MongoProxy approach. Initially \u0027find\u0027 return Cursor"},{"line_number":407,"context_line":"        # object and doesn\u0027t connect to db while Cursor is not used."},{"line_number":408,"context_line":"        found \u003d self.find(*args, **kwargs)"},{"line_number":409,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_d4411e64","line":406,"range":{"start_line":406,"start_character":13,"end_line":406,"end_character":18},"in_reply_to":"baa201ad_54744efd","updated":"2014-10-16 09:22:59.000000000","message":"Done","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"2cde7ffac9decf137ea69f0ca2ff89e04df71a19","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"def safe_mongo_call(call):"},{"line_number":334,"context_line":"    def closure(*args, **kwargs):"},{"line_number":335,"context_line":"        max_retries \u003d cfg.CONF.database.max_retries"},{"line_number":336,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":337,"context_line":"        attempts \u003d 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_dfe6cbaf","line":334,"updated":"2014-10-23 09:09:57.000000000","message":"Shouldn\u0027t we validate the values of max_retries and retry_interval? I didn\u0027t find any default values, can it be None or negative values?","commit_id":"b888f9140d9ab99a6a44a618feb20d5c9d499634"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"86120d64ae5d5ecb7d220261fa80103b141f92b6","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"def safe_mongo_call(call):"},{"line_number":334,"context_line":"    def closure(*args, **kwargs):"},{"line_number":335,"context_line":"        max_retries \u003d cfg.CONF.database.max_retries"},{"line_number":336,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":337,"context_line":"        attempts \u003d 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_a533ba12","line":334,"in_reply_to":"9aa7fdbe_85d6b6ef","updated":"2014-10-23 10:15:14.000000000","message":"max_retries and retry_interval should be a numbers default values are here https://github.com/openstack/oslo.db/blob/master/oslo/db/options.py#L77 and at line 86","commit_id":"b888f9140d9ab99a6a44a618feb20d5c9d499634"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"4da56de8bcfc73cd4a038bd134ed61499d5ae508","unresolved":false,"context_lines":[{"line_number":331,"context_line":""},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"def safe_mongo_call(call):"},{"line_number":334,"context_line":"    def closure(*args, **kwargs):"},{"line_number":335,"context_line":"        max_retries \u003d cfg.CONF.database.max_retries"},{"line_number":336,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":337,"context_line":"        attempts \u003d 0"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_85d6b6ef","line":334,"in_reply_to":"9aa7fdbe_dfe6cbaf","updated":"2014-10-23 09:48:51.000000000","message":"It might be only numbers. Negative ones mean \u0027try forever\u0027","commit_id":"b888f9140d9ab99a6a44a618feb20d5c9d499634"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"2cde7ffac9decf137ea69f0ca2ff89e04df71a19","unresolved":false,"context_lines":[{"line_number":407,"context_line":"        # object and doesn\u0027t connect to db while Cursor is not used."},{"line_number":408,"context_line":"        found \u003d self.find(*args, **kwargs)"},{"line_number":409,"context_line":"        try:"},{"line_number":410,"context_line":"            found[0]"},{"line_number":411,"context_line":"        except IndexError:"},{"line_number":412,"context_line":"                pass"},{"line_number":413,"context_line":"        return found"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_62b7083b","line":410,"updated":"2014-10-23 09:09:57.000000000","message":"Why do we need the following code? We catch IndexError but anyway return \u0027found\u0027. \u0027found\u0027 may be an array and an object as well?","commit_id":"b888f9140d9ab99a6a44a618feb20d5c9d499634"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"86120d64ae5d5ecb7d220261fa80103b141f92b6","unresolved":false,"context_lines":[{"line_number":407,"context_line":"        # object and doesn\u0027t connect to db while Cursor is not used."},{"line_number":408,"context_line":"        found \u003d self.find(*args, **kwargs)"},{"line_number":409,"context_line":"        try:"},{"line_number":410,"context_line":"            found[0]"},{"line_number":411,"context_line":"        except IndexError:"},{"line_number":412,"context_line":"                pass"},{"line_number":413,"context_line":"        return found"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa7fdbe_05164655","line":410,"in_reply_to":"9aa7fdbe_62b7083b","updated":"2014-10-23 10:15:14.000000000","message":"We return an object that was got from the db. And found we use to check connection with db otherwise find method returns Cursor object without checking for Authoreconnect exception.","commit_id":"b888f9140d9ab99a6a44a618feb20d5c9d499634"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"d0fd68355c28a9db8800d1042e7ac9acf11725eb","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        except pymongo.errors.ConnectionFailure as e:"},{"line_number":193,"context_line":"            LOG.warn(_(\u0027Unable to connect to the database server: \u0027"},{"line_number":194,"context_line":"                       \u0027%(errmsg)s.\u0027) % {\u0027errmsg\u0027: e})"},{"line_number":195,"context_line":"            raise"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class QueryTransformer(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9aa7fdbe_13168c55","line":195,"updated":"2014-10-23 11:46:36.000000000","message":"can this try...except statement be removed? because the safe_mongo_call() method has addressed the connection exception.","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"1c4e88835e7401882efd96e1e3554a967fbf938b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        except pymongo.errors.ConnectionFailure as e:"},{"line_number":193,"context_line":"            LOG.warn(_(\u0027Unable to connect to the database server: \u0027"},{"line_number":194,"context_line":"                       \u0027%(errmsg)s.\u0027) % {\u0027errmsg\u0027: e})"},{"line_number":195,"context_line":"            raise"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class QueryTransformer(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9aa7fdbe_ae2d5700","line":195,"in_reply_to":"9aa7fdbe_13168c55","updated":"2014-10-23 12:03:58.000000000","message":"No it cannot be removed here we check if connection exist and in safe_mongo_call we only catch AutoReconnect exception","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"},{"author":{"_account_id":8290,"name":"liusheng","email":"liusheng2048@gmail.com","username":"LiuSheng"},"change_message_id":"2882de0ceeb0109238e864c43d5757fe14976bfa","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        except pymongo.errors.ConnectionFailure as e:"},{"line_number":193,"context_line":"            LOG.warn(_(\u0027Unable to connect to the database server: \u0027"},{"line_number":194,"context_line":"                       \u0027%(errmsg)s.\u0027) % {\u0027errmsg\u0027: e})"},{"line_number":195,"context_line":"            raise"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class QueryTransformer(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9aa7fdbe_5d11ec5b","line":195,"in_reply_to":"9aa7fdbe_ae2d5700","updated":"2014-10-24 07:35:04.000000000","message":"thanks for clarification :) LGTM!","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"}],"ceilometer/storage/pymongo_base.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            q[\u0027source\u0027] \u003d source"},{"line_number":85,"context_line":"        q.update(metaquery)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"        while True:"},{"line_number":88,"context_line":"            try:"},{"line_number":89,"context_line":"                meters \u003d list(self.db.resource.find(q))"},{"line_number":90,"context_line":"            except pymongo.errors.AutoReconnect:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f3c30a37","line":87,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    def get_event_types(self):"},{"line_number":183,"context_line":"        \"\"\"Return all event types as an iter of strings.\"\"\""},{"line_number":184,"context_line":"        event_types \u003d set()"},{"line_number":185,"context_line":"        while True:"},{"line_number":186,"context_line":"            try:"},{"line_number":187,"context_line":"                events \u003d list(self.db.event.find())"},{"line_number":188,"context_line":"            except pymongo.errors.AutoReconnect:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_93e63ee7","line":185,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"7e4f6cfc6760d1e1266766fb3a8436e15ca8f461","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        :param event_type: the type of the Event."},{"line_number":205,"context_line":"        \"\"\""},{"line_number":206,"context_line":"        trait_names \u003d set()"},{"line_number":207,"context_line":"        while True:"},{"line_number":208,"context_line":"            try:"},{"line_number":209,"context_line":"                events \u003d list(self.db.event.find({\u0027event_type\u0027: event_type}))"},{"line_number":210,"context_line":"            except pymongo.errors.AutoReconnect:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_d3cfe655","line":207,"updated":"2014-09-18 11:07:57.000000000","message":"ditto","commit_id":"935807b6c624eab4fa8744036d374fa08de78500"}],"ceilometer/tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"53f62a37c330aac43ee0565427c85e2eb17685bd","unresolved":false,"context_lines":[{"line_number":3104,"context_line":"            s, self.CONF.publisher.metering_secret)"},{"line_number":3105,"context_line":"        self.conn.record_metering_data(msg)"},{"line_number":3106,"context_line":""},{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"class MongoAutoReconnectTest(DBTestBase,"},{"line_number":3109,"context_line":"                             tests_db.MixinTestsWithBackendScenarios):"},{"line_number":3110,"context_line":"    cfg.CONF.set_override(\u0027retry_interval\u0027, 1, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_74df92d6","line":3107,"updated":"2014-10-16 09:15:43.000000000","message":"Test class name should start with \u0027Test\u0027, otherwise tests won\u0027t be run... May you name this class as TestMongoAutoReconnection and check if it\u0027s still working?","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"11b9a17ec63a3dfe3bc553d4b44e41b3e9100ee8","unresolved":false,"context_lines":[{"line_number":3104,"context_line":"            s, self.CONF.publisher.metering_secret)"},{"line_number":3105,"context_line":"        self.conn.record_metering_data(msg)"},{"line_number":3106,"context_line":""},{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"class MongoAutoReconnectTest(DBTestBase,"},{"line_number":3109,"context_line":"                             tests_db.MixinTestsWithBackendScenarios):"},{"line_number":3110,"context_line":"    cfg.CONF.set_override(\u0027retry_interval\u0027, 1, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_5490ceec","line":3107,"in_reply_to":"baa201ad_74df92d6","updated":"2014-10-16 09:22:59.000000000","message":"It seems that this rule was already declaimed. All tests classes here are named with Test at the end.","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"51b041e708a1843bbb414a1b1d034a5721b512b2","unresolved":false,"context_lines":[{"line_number":3104,"context_line":"            s, self.CONF.publisher.metering_secret)"},{"line_number":3105,"context_line":"        self.conn.record_metering_data(msg)"},{"line_number":3106,"context_line":""},{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"class MongoAutoReconnectTest(DBTestBase,"},{"line_number":3109,"context_line":"                             tests_db.MixinTestsWithBackendScenarios):"},{"line_number":3110,"context_line":"    cfg.CONF.set_override(\u0027retry_interval\u0027, 1, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baa201ad_3487cab6","line":3107,"in_reply_to":"baa201ad_74df92d6","updated":"2014-10-16 09:20:38.000000000","message":"a-ha sorry, please skip this my comment, it looks like I\u0027m crazy a bit here","commit_id":"95337b7cbf9381115395d5d51f6a9c07976850bc"},{"author":{"_account_id":12119,"name":"Can ZHANG","email":"zhangcan@letv.com","username":"can_zhang"},"change_message_id":"2eef0fad78da8ffe2265795f829f1c19cc72ac4b","unresolved":false,"context_lines":[{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"class MongoAutoReconnectTest(DBTestBase,"},{"line_number":3109,"context_line":"                             tests_db.MixinTestsWithBackendScenarios):"},{"line_number":3110,"context_line":"    cfg.CONF.set_override(\u0027retry_interval\u0027, 1, group\u003d\u0027database\u0027)"},{"line_number":3111,"context_line":""},{"line_number":3112,"context_line":"    @tests_db.run_with(\u0027mongodb\u0027)"},{"line_number":3113,"context_line":"    def test_mongo_client(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a890539_25bc8269","line":3110,"updated":"2014-11-11 04:03:10.000000000","message":"This line seems to be of no effect. In gate-ceilometer-python27 console log, I can see:\n\nRuntime (s)\n2014-10-23 11:17:36.981 | ----------------------------------------------------------------------------------------------------------------------------------------  -----------\n2014-10-23 11:17:36.981 | ceilometer.tests.storage.test_storage_scenarios.MongoAutoReconnectTest.test_mongo_find_and_modify(mongodb)                                10.082\n2014-10-23 11:17:36.981 | ceilometer.tests.storage.test_storage_scenarios.MongoAutoReconnectTest.test_mongo_update(mongodb)                                         10.082\n2014-10-23 11:17:36.981 | ceilometer.tests.storage.test_storage_scenarios.MongoAutoReconnectTest.test_mongo_insert(mongodb)                                         10.078\n2014-10-23 11:17:36.981 | ceilometer.tests.storage.test_storage_scenarios.MongoAutoReconnectTest.test_mongo_find(mongodb)                                           10.060\n\nwhere 10s is the default retry interval.","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"466455ee1afdcf00d8d72676c204a939b993f8d0","unresolved":false,"context_lines":[{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"class MongoAutoReconnectTest(DBTestBase,"},{"line_number":3109,"context_line":"                             tests_db.MixinTestsWithBackendScenarios):"},{"line_number":3110,"context_line":"    cfg.CONF.set_override(\u0027retry_interval\u0027, 1, group\u003d\u0027database\u0027)"},{"line_number":3111,"context_line":""},{"line_number":3112,"context_line":"    @tests_db.run_with(\u0027mongodb\u0027)"},{"line_number":3113,"context_line":"    def test_mongo_client(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a890539_b3f35772","line":3110,"in_reply_to":"5a890539_25bc8269","updated":"2014-11-11 11:37:47.000000000","message":"https://review.openstack.org/#/c/133351 will fix it","commit_id":"21d882c96cbbaeb8b78ff91e06e3615be97bff07"}]}
