)]}'
{"ceilometer/storage/pymongo_base.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"43d21fd67ff5569ca3573472a29cce5d2b828097","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":35,"context_line":"CONNECT_RETRIES \u003d None  # try forever"},{"line_number":36,"context_line":"CONNECT_INTERVAL \u003d 10"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2Fsns%3D","line":36,"updated":"2014-04-11 03:13:22.000000000","message":"How about make the two global variable to configurable options?\n\nor should we just use [database] max_retries\u003d10 and retry_interval\u003d10 in etc/ceilometer/ceilometer.conf.sample?\n\nI think the second choice is better","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"6cf947bdebbeae80fc8d214463d842a136d58c9c","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":35,"context_line":"CONNECT_RETRIES \u003d None  # try forever"},{"line_number":36,"context_line":"CONNECT_INTERVAL \u003d 10"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2Fhuc%3D","line":36,"in_reply_to":"AAAAW3%2F%2Fh%2Bo%3D","updated":"2014-04-13 20:07:10.000000000","message":"+1 to Nadya Privalova\n\nif the required database is not available after a tolerable time, than we should finish quickly, and inform the operator to check what has happened\n\nI have another patch to exit collector service in such case (just advertise :) https://review.openstack.org/#/c/86155/)","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"3a1b463dec6f517466aff088e07ddc99cef80f21","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":35,"context_line":"CONNECT_RETRIES \u003d None  # try forever"},{"line_number":36,"context_line":"CONNECT_INTERVAL \u003d 10"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2Fh%2Bo%3D","line":36,"in_reply_to":"AAAAW3%2F%2FoWo%3D","updated":"2014-04-13 16:53:36.000000000","message":"+1. Besides, I don\u0027t like an assumption that None\u003dtry forever. I think we should not allow it","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"f444e91b81cec6e8e1a377a6f4da7e48f0148b36","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":35,"context_line":"CONNECT_RETRIES \u003d None  # try forever"},{"line_number":36,"context_line":"CONNECT_INTERVAL \u003d 10"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2FoWo%3D","line":36,"in_reply_to":"AAAAW3%2F%2Foa8%3D","updated":"2014-04-11 15:02:52.000000000","message":"Emilio, the options in ceilometer conf are taken from options defined in code. you can see the db related values here (note defaults are defined sometimes): https://github.com/openstack/ceilometer/blob/master/ceilometer/openstack/common/db/options.py\n\nZhiQiang, +1, i like the suggestion to us database conf options.","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":10242,"name":"Emilio Recio","email":"emiliorecio@gmail.com","username":"emiliorecio"},"change_message_id":"8377d385c21e963a32c043e566e2737c06823bee","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":35,"context_line":"CONNECT_RETRIES \u003d None  # try forever"},{"line_number":36,"context_line":"CONNECT_INTERVAL \u003d 10"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2Foa8%3D","line":36,"in_reply_to":"AAAAW3%2F%2Fsns%3D","updated":"2014-04-11 14:57:45.000000000","message":"Im new in Celometer, Im not shure how ceilometer.conf its handled in case the option in the file its not there. Its defined in the s. code with default values?","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"26933611814472ab63e9abafb54ef9174b36fa92","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        self._pool[pool_key] \u003d weakref.ref(client)"},{"line_number":129,"context_line":"        return client"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def _connect(self, url):"},{"line_number":132,"context_line":"        attempts \u003d 0"},{"line_number":133,"context_line":"        while True:"},{"line_number":134,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2FvZM%3D","line":131,"updated":"2014-04-10 17:44:10.000000000","message":"@staticmethod\n\nIt seems to be a bit odd to me to have two methods with almost the same name. It could be maybe something like connect_to_client.","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4a6ff4f1ac8cac12594c4e6668a2d278e3560f47","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":137,"context_line":"                if CONNECT_RETRIES and attempts \u003e\u003d CONNECT_RETRIES:"},{"line_number":138,"context_line":"                    LOG.error(_(\u0027Unable to connect to MongoDB after \u0027"},{"line_number":139,"context_line":"                                \u0027%(retries) retries. Giving up.\u0027) %"},{"line_number":140,"context_line":"                              {\u0027retries\u0027: CONNECT_RETRIES})"},{"line_number":141,"context_line":"                    raise"},{"line_number":142,"context_line":"                LOG.error(_(\u0027Unable to connect to MongoDB server: %(errmsg)s\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2FsmI%3D","line":139,"updated":"2014-04-11 03:15:58.000000000","message":"s/%(retries)/%(retries)d/\n\ni think %d is ok, since it is not None in this condition branch","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"43d21fd67ff5569ca3573472a29cce5d2b828097","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                              {\u0027retries\u0027: CONNECT_RETRIES})"},{"line_number":141,"context_line":"                    raise"},{"line_number":142,"context_line":"                LOG.error(_(\u0027Unable to connect to MongoDB server: %(errmsg)s\u0027"},{"line_number":143,"context_line":"                            \u0027 Trying again in %(sleep_time)d seconds.\u0027) %"},{"line_number":144,"context_line":"                          {\u0027errmsg\u0027: str(e), \u0027sleep_time\u0027: CONNECT_INTERVAL})"},{"line_number":145,"context_line":"                attempts +\u003d 1"},{"line_number":146,"context_line":"                time.sleep(CONNECT_INTERVAL)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2FsoA%3D","line":143,"updated":"2014-04-11 03:13:22.000000000","message":"nit: missing \u0027.\u0027 in front of \u0027Trying\u0027 ? since it is a start of sentence","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"43d21fd67ff5569ca3573472a29cce5d2b828097","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                    raise"},{"line_number":142,"context_line":"                LOG.error(_(\u0027Unable to connect to MongoDB server: %(errmsg)s\u0027"},{"line_number":143,"context_line":"                            \u0027 Trying again in %(sleep_time)d seconds.\u0027) %"},{"line_number":144,"context_line":"                          {\u0027errmsg\u0027: str(e), \u0027sleep_time\u0027: CONNECT_INTERVAL})"},{"line_number":145,"context_line":"                attempts +\u003d 1"},{"line_number":146,"context_line":"                time.sleep(CONNECT_INTERVAL)"},{"line_number":147,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAW3%2F%2Fsok%3D","line":144,"updated":"2014-04-11 03:13:22.000000000","message":"i think the str() is duplicate for %s","commit_id":"55214cd116df2229ace22f5448c4f37e2d945406"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"3240a893f08b9c95e33ef814537f4bf1b178e2d0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from ceilometer import utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_timestamp_range(start, end,"},{"line_number":39,"context_line":"                         start_timestamp_op\u003dNone, end_timestamp_op\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAW3%2F%2FdTk%3D","line":36,"updated":"2014-04-14 13:31:50.000000000","message":"add \ncfg.CONF.import_opt(\u0027max_retries\u0027, \u0027ceilometer.openstack.common.db.options\u0027,\n                    group\u003d\"database\")\ncfg.CONF.import_opt(\u0027retry_interval\u0027, \u0027ceilometer.openstack.common.db.options\u0027,\n                    group\u003d\"database\")\n\nthis ensures the options are loaded.","commit_id":"b6206889c20b88ab3f43d4ecf588780183a71c35"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5bdd0286b9d44fb01e1b1404115abbecadd71555","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from ceilometer import utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_timestamp_range(start, end,"},{"line_number":39,"context_line":"                         start_timestamp_op\u003dNone, end_timestamp_op\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAW3%2F%2FcFk%3D","line":36,"in_reply_to":"AAAAW3%2F%2Fccw%3D","updated":"2014-04-14 15:26:43.000000000","message":"Thanks for the info, I found the appropriate section finally.","commit_id":"b6206889c20b88ab3f43d4ecf588780183a71c35"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"488b013088a75ba1587e52a28bf0cef23bc49899","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from ceilometer import utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_timestamp_range(start, end,"},{"line_number":39,"context_line":"                         start_timestamp_op\u003dNone, end_timestamp_op\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAW3%2F%2Fccw%3D","line":36,"in_reply_to":"AAAAW3%2F%2FdRI%3D","updated":"2014-04-14 15:02:50.000000000","message":"the two options do have default value, since sql has reconnect feature, I think they will not be removed in recent release.","commit_id":"b6206889c20b88ab3f43d4ecf588780183a71c35"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"2dbc373d15efd883e67afb5ba78f213f41e28654","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from ceilometer import utils"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def make_timestamp_range(start, end,"},{"line_number":39,"context_line":"                         start_timestamp_op\u003dNone, end_timestamp_op\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAW3%2F%2FdRI%3D","line":36,"in_reply_to":"AAAAW3%2F%2FdTk%3D","updated":"2014-04-14 13:39:19.000000000","message":"Also add a default value for the case, if the above listed parameters are not defined.","commit_id":"b6206889c20b88ab3f43d4ecf588780183a71c35"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"e92ebff01bab05d10dc7578155110a1822fde07a","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to MongoDB after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":6,"id":"bad4c104_5af33573","line":144,"updated":"2014-04-29 08:14:18.000000000","message":"it\u0027s a common file. I guess that user would be surprised when he tries to connect DB2 but in logs there is error about MongoDB. Maybe we just change \"MongoDB\" to \"database\"?","commit_id":"66dd29f6e9c841c9afda8bdd65d38b105109c769"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"d2a32297762ee339bebdfd9c8166931d55c60270","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to MongoDB after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_5adb221b","line":144,"in_reply_to":"9ad9bd40_c6aa02d4","updated":"2014-04-30 15:50:49.000000000","message":"Ok, then. I apologize for my ignorance. I\u0027ve pushed amended the patch.","commit_id":"66dd29f6e9c841c9afda8bdd65d38b105109c769"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"3e41393c4b8f88caea09ef6f4c6f843d0e03558f","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to MongoDB after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":6,"id":"bad4c104_fa2ec9a4","line":144,"in_reply_to":"bad4c104_5af33573","updated":"2014-04-29 08:18:48.000000000","message":"pymongo.MongoClient can only connect to MongoDB AFAIK.","commit_id":"66dd29f6e9c841c9afda8bdd65d38b105109c769"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"c0d9c222163a94567457ffab766a85422d500042","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to MongoDB after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad9bd40_c6aa02d4","line":144,"in_reply_to":"bad4c104_fa2ec9a4","updated":"2014-04-30 15:05:17.000000000","message":"Nadya is correct. db2 nosql solution uses the same base as mongo","commit_id":"66dd29f6e9c841c9afda8bdd65d38b105109c769"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"e00bd535e48ac2c36115e26f37078cce5308c17e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"cfg.CONF.import_opt(\u0027max_retries\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":38,"context_line":"                    group\u003d\"database\")"},{"line_number":39,"context_line":"cfg.CONF.import_opt(\u0027retry_interval\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":40,"context_line":"                    group\u003d\"database\")"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_98e4c03c","line":40,"updated":"2014-05-01 11:29:49.000000000","message":"Should this interval be exponentially backed off?","commit_id":"ca569ffb246669518fa2e0a5da53e93039947a0b"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"677190c1ee56d899877128f1ec7c21e896e0961b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"cfg.CONF.import_opt(\u0027max_retries\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":38,"context_line":"                    group\u003d\"database\")"},{"line_number":39,"context_line":"cfg.CONF.import_opt(\u0027retry_interval\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":40,"context_line":"                    group\u003d\"database\")"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_2c51c662","line":40,"in_reply_to":"9ad9bd40_8078b490","updated":"2014-05-08 08:27:39.000000000","message":"I think we should keep these 2 configuration the same meaning for both sqlalchemy and mongo.","commit_id":"ca569ffb246669518fa2e0a5da53e93039947a0b"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"53b4aba8d93871a608e65b565c85ea8ed34540f9","unresolved":false,"context_lines":[{"line_number":37,"context_line":"cfg.CONF.import_opt(\u0027max_retries\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":38,"context_line":"                    group\u003d\"database\")"},{"line_number":39,"context_line":"cfg.CONF.import_opt(\u0027retry_interval\u0027, \u0027ceilometer.openstack.common.db.options\u0027,"},{"line_number":40,"context_line":"                    group\u003d\"database\")"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def make_timestamp_range(start, end,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_8078b490","line":40,"in_reply_to":"9ad9bd40_98e4c03c","updated":"2014-05-02 09:24:49.000000000","message":"That sounds overkill to me and I think it would make it harder to document and for sysops to understand the behavior.\n\nI\u0027m interested in what others have to say, too, though.","commit_id":"ca569ffb246669518fa2e0a5da53e93039947a0b"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"cf6dc778295213a931034c3a1611986a44da0280","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to the database after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_ebf58b57","line":144,"updated":"2014-05-16 09:11:28.000000000","message":"Will it be validated somewhere that max_retries should be non-negative? Looks like we go to infinite loop if max_retries is -1","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"8a1cfafacc5769dc63a3f5c4d886940db994e2f5","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to the database after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_d64f9669","line":144,"in_reply_to":"7adec928_eb1f4b6a","updated":"2014-05-16 09:21:29.000000000","message":"@Ionut Artarisi\t\n\n+1","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"565d5358351297c5605d8c4a0d3b716bbad9a9c4","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to the database after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_b6468a4d","line":144,"in_reply_to":"7adec928_eb1f4b6a","updated":"2014-05-16 09:21:38.000000000","message":"Ah, I see. btw, we may determine max and min value using oslo.conf: https://github.com/openstack/oslo.config/blob/master/oslo/config/types.py","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"11c9b902a8483211add294454f74ee076515f293","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            try:"},{"line_number":142,"context_line":"                client \u003d pymongo.MongoClient(url, safe\u003dTrue)"},{"line_number":143,"context_line":"            except pymongo.errors.ConnectionFailure as e:"},{"line_number":144,"context_line":"                if max_retries \u003e\u003d 0 and attempts \u003e\u003d max_retries:"},{"line_number":145,"context_line":"                    LOG.error(_(\u0027Unable to connect to the database after \u0027"},{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_eb1f4b6a","line":144,"in_reply_to":"7adec928_ebf58b57","updated":"2014-05-16 09:14:45.000000000","message":"IMHO that is a feature not a bug. retry_interval is set by default to a positive value. If the admin decides to set it to a negative value, he is probably assuming that it will retry forever.","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"74fd9692134730bc7a416cd13c8ec50312e85fe0","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"},{"line_number":148,"context_line":"                    raise"},{"line_number":149,"context_line":"                LOG.error(_(\u0027Unable to connect to the database server: \u0027"},{"line_number":150,"context_line":"                            \u0027%(errmsg)s. Trying again in %(retry_interval)d \u0027"},{"line_number":151,"context_line":"                            \u0027seconds.\u0027) %"},{"line_number":152,"context_line":"                          {\u0027errmsg\u0027: e, \u0027retry_interval\u0027: retry_interval})"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_bff33609","line":149,"updated":"2014-05-27 18:07:55.000000000","message":"up for debate but this is one of the cases where it\u0027s debatable where if it should be a error or a warning... the two log level should definitely be different since they\u0027re clearly different severity...\n\ni\u0027d say this should be a warning but that\u0027s just me.\n\nsee: https://blueprints.launchpad.net/ceilometer/+spec/logging-ceilometer\nhttps://review.openstack.org/#/c/91446/3/specs/juno/log-guidelines.rst","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"e559480cca826e3f36ff2910b70f2e8f57be59d7","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                                \u0027%(retries)d retries. Giving up.\u0027) %"},{"line_number":147,"context_line":"                              {\u0027retries\u0027: max_retries})"},{"line_number":148,"context_line":"                    raise"},{"line_number":149,"context_line":"                LOG.error(_(\u0027Unable to connect to the database server: \u0027"},{"line_number":150,"context_line":"                            \u0027%(errmsg)s. Trying again in %(retry_interval)d \u0027"},{"line_number":151,"context_line":"                            \u0027seconds.\u0027) %"},{"line_number":152,"context_line":"                          {\u0027errmsg\u0027: e, \u0027retry_interval\u0027: retry_interval})"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_2c536d18","line":149,"in_reply_to":"3ae8d1ca_bff33609","updated":"2014-05-28 09:07:31.000000000","message":"Done","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"}],"ceilometer/tests/storage/test_pymongo_base.py":[{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"144d2c4dbbf86fc88fdaafef6b9f710404ce4568","unresolved":false,"context_lines":[{"line_number":13,"context_line":"\"\"\"Tests the mongodb and db2 common functionality"},{"line_number":14,"context_line":"\"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from contextlib import nested"},{"line_number":17,"context_line":"import copy"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FN4U%3D","line":16,"updated":"2014-04-23 08:59:36.000000000","message":"That\u0027s strange, because mock.patch is a method and it worked that way in the old version of this code.","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4c2f272a32ff78674a9adeeee97ae0bd7f904902","unresolved":false,"context_lines":[{"line_number":13,"context_line":"\"\"\"Tests the mongodb and db2 common functionality"},{"line_number":14,"context_line":"\"\"\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from contextlib import nested"},{"line_number":17,"context_line":"import copy"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2Fk7E%3D","line":16,"updated":"2014-04-19 05:47:01.000000000","message":"hacking only allows import module, not method","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4c2f272a32ff78674a9adeeee97ae0bd7f904902","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import copy"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from mock import call, patch"},{"line_number":21,"context_line":"import pymongo"},{"line_number":22,"context_line":"import testscenarios"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2Fk7Q%3D","line":20,"updated":"2014-04-19 05:47:01.000000000","message":"hacking doesn\u0027t allow import two module in one line","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"144d2c4dbbf86fc88fdaafef6b9f710404ce4568","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import copy"},{"line_number":18,"context_line":"import datetime"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from mock import call, patch"},{"line_number":21,"context_line":"import pymongo"},{"line_number":22,"context_line":"import testscenarios"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FN4I%3D","line":20,"in_reply_to":"AAAAXH%2F%2Fk7Q%3D","updated":"2014-04-23 08:59:36.000000000","message":"Done","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4c2f272a32ff78674a9adeeee97ae0bd7f904902","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    db_manager \u003d tests_db.MongoDbManager()"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":185,"context_line":"        RETRY_INTERVAL \u003d 13"},{"line_number":186,"context_line":"        MAX_RETRIES \u003d 37"},{"line_number":187,"context_line":"        self.CONF.set_override("},{"line_number":188,"context_line":"            \u0027retry_interval\u0027, RETRY_INTERVAL, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2Fk7I%3D","line":185,"updated":"2014-04-19 05:47:01.000000000","message":"optional nit: usually, local var doesn\u0027t need to be upper case","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"144d2c4dbbf86fc88fdaafef6b9f710404ce4568","unresolved":false,"context_lines":[{"line_number":182,"context_line":"    db_manager \u003d tests_db.MongoDbManager()"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":185,"context_line":"        RETRY_INTERVAL \u003d 13"},{"line_number":186,"context_line":"        MAX_RETRIES \u003d 37"},{"line_number":187,"context_line":"        self.CONF.set_override("},{"line_number":188,"context_line":"            \u0027retry_interval\u0027, RETRY_INTERVAL, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FN4Q%3D","line":185,"in_reply_to":"AAAAXH%2F%2Fk7I%3D","updated":"2014-04-23 08:59:36.000000000","message":"Done","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"4c2f272a32ff78674a9adeeee97ae0bd7f904902","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        self.CONF.set_override("},{"line_number":190,"context_line":"            \u0027max_retries\u0027, MAX_RETRIES, group\u003d\u0027database\u0027)"},{"line_number":191,"context_line":"        pool \u003d pymongo_base.ConnectionPool()"},{"line_number":192,"context_line":"        # self.CONF.set_override"},{"line_number":193,"context_line":"        with nested("},{"line_number":194,"context_line":"                patch(\u0027pymongo.MongoClient\u0027,"},{"line_number":195,"context_line":"                      side_effect\u003dpymongo.errors.ConnectionFailure(\u0027foo\u0027)),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2Fk7M%3D","line":192,"updated":"2014-04-19 05:47:01.000000000","message":"commented statement should be removed directly","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"144d2c4dbbf86fc88fdaafef6b9f710404ce4568","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        self.CONF.set_override("},{"line_number":190,"context_line":"            \u0027max_retries\u0027, MAX_RETRIES, group\u003d\u0027database\u0027)"},{"line_number":191,"context_line":"        pool \u003d pymongo_base.ConnectionPool()"},{"line_number":192,"context_line":"        # self.CONF.set_override"},{"line_number":193,"context_line":"        with nested("},{"line_number":194,"context_line":"                patch(\u0027pymongo.MongoClient\u0027,"},{"line_number":195,"context_line":"                      side_effect\u003dpymongo.errors.ConnectionFailure(\u0027foo\u0027)),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FN4M%3D","line":192,"in_reply_to":"AAAAXH%2F%2Fk7M%3D","updated":"2014-04-23 08:59:36.000000000","message":"Done","commit_id":"d8bf63a924bb622a5ddd94795370a68e6b6a2764"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"74fd9692134730bc7a416cd13c8ec50312e85fe0","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import pymongo"},{"line_number":23,"context_line":"import testscenarios"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from ceilometer.openstack.common.gettextutils import _  # noqa"},{"line_number":26,"context_line":"from ceilometer.publisher import utils"},{"line_number":27,"context_line":"from ceilometer import sample"},{"line_number":28,"context_line":"from ceilometer.storage import pymongo_base"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_a9794895","line":25,"updated":"2014-05-27 18:07:55.000000000","message":"you can drop # noqa","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"e559480cca826e3f36ff2910b70f2e8f57be59d7","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import pymongo"},{"line_number":23,"context_line":"import testscenarios"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from ceilometer.openstack.common.gettextutils import _  # noqa"},{"line_number":26,"context_line":"from ceilometer.publisher import utils"},{"line_number":27,"context_line":"from ceilometer import sample"},{"line_number":28,"context_line":"from ceilometer.storage import pymongo_base"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_0c4eb16f","line":25,"in_reply_to":"3ae8d1ca_a9794895","updated":"2014-05-28 09:07:31.000000000","message":"Done","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"74fd9692134730bc7a416cd13c8ec50312e85fe0","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"class ConnectionPoolTest(tests_db.TestBase):"},{"line_number":183,"context_line":"    db_manager \u003d tests_db.MongoDbManager()"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":186,"context_line":"        retry_interval \u003d 13"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_24d8fdee","line":183,"updated":"2014-05-27 18:07:55.000000000","message":"this should probably test against db2 driver as well since it\u0027s modifying common pymongo_base","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"e559480cca826e3f36ff2910b70f2e8f57be59d7","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"class ConnectionPoolTest(tests_db.TestBase):"},{"line_number":183,"context_line":"    db_manager \u003d tests_db.MongoDbManager()"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":186,"context_line":"        retry_interval \u003d 13"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_ec3185ed","line":183,"in_reply_to":"3ae8d1ca_24d8fdee","updated":"2014-05-28 09:07:31.000000000","message":"Done","commit_id":"4234a90a9f7ff4af4752db079892ae3ab5f7e057"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"55e1b3f12e65629166a76c42fa4031fc580e5981","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        meters \u003d list(self.conn.get_meters())"},{"line_number":179,"context_line":"        self.assertEqual(1, len(meters))"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":182,"context_line":"        retry_interval \u003d 13"},{"line_number":183,"context_line":"        max_retries \u003d 37"},{"line_number":184,"context_line":"        self.CONF.set_override("}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_e2195b89","line":181,"updated":"2014-05-29 14:00:46.000000000","message":"Isn\u0027t it too much :)? The test will be running for 13*37 seconds?","commit_id":"ced867e7feabe830ca193add5437f12276b9dc05"},{"author":{"_account_id":2340,"name":"Ionut Artarisi","email":"iartarisi@suse.cz","username":"mapleoin"},"change_message_id":"5550226fc97a26f5d1c6306945062184a246089f","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        meters \u003d list(self.conn.get_meters())"},{"line_number":179,"context_line":"        self.assertEqual(1, len(meters))"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":182,"context_line":"        retry_interval \u003d 13"},{"line_number":183,"context_line":"        max_retries \u003d 37"},{"line_number":184,"context_line":"        self.CONF.set_override("}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_890fda2d","line":181,"in_reply_to":"3ae8d1ca_b5514bda","updated":"2014-05-29 15:37:16.000000000","message":"Yes, the sleep method is mocked and running that test takes less than a second:\n\nhttp://paste.openstack.org/raw/82052/","commit_id":"ced867e7feabe830ca193add5437f12276b9dc05"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"8b146cf043c46bd0904d95458ac9430c0ab40d67","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        meters \u003d list(self.conn.get_meters())"},{"line_number":179,"context_line":"        self.assertEqual(1, len(meters))"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_mongodb_connect_raises_after_custom_number_of_attempts(self):"},{"line_number":182,"context_line":"        retry_interval \u003d 13"},{"line_number":183,"context_line":"        max_retries \u003d 37"},{"line_number":184,"context_line":"        self.CONF.set_override("}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_b5514bda","line":181,"in_reply_to":"3ae8d1ca_e2195b89","updated":"2014-05-29 14:07:12.000000000","message":"i thought the same thing... i believe since we\u0027re patching sleep below, in reality, we\u0027re skipping the delay.\n\nor i could be completely wrong... then we should fix this. :)","commit_id":"ced867e7feabe830ca193add5437f12276b9dc05"}]}
