)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1578917d70383ba42d5b5e96bd03bdb22b95014a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch https://review.openstack.org/#/c/122387 works fine"},{"line_number":10,"context_line":"with operations with get, record and update functions."},{"line_number":11,"context_line":"But exception would still occured with the operation of db.collection.find() function."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch can give some benifit to tolerance DB restart with find() function."},{"line_number":14,"context_line":"Since ceilometer mostly use \"yield\" to get each find() element, we can only except the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5a890539_bd26a266","line":11,"updated":"2014-11-20 13:37:56.000000000","message":"Too long line, line in commit message should be less than 80 letters.","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"56d0373f33ac7b8b80677b26794086638bb413fb","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch https://review.openstack.org/#/c/122387 works fine"},{"line_number":10,"context_line":"with operations with get, record and update functions."},{"line_number":11,"context_line":"But exception would still occured with the operation of db.collection.find() function."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch can give some benifit to tolerance DB restart with find() function."},{"line_number":14,"context_line":"Since ceilometer mostly use \"yield\" to get each find() element, we can only except the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5a890539_c1f7e957","line":11,"in_reply_to":"5a890539_bd26a266","updated":"2014-11-21 06:16:09.000000000","message":"Done","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1578917d70383ba42d5b5e96bd03bdb22b95014a","unresolved":false,"context_lines":[{"line_number":11,"context_line":"But exception would still occured with the operation of db.collection.find() function."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch can give some benifit to tolerance DB restart with find() function."},{"line_number":14,"context_line":"Since ceilometer mostly use \"yield\" to get each find() element, we can only except the"},{"line_number":15,"context_line":"\"AutoReconnect\" exceptions in \"yield\" functions."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ia0474726960ce2b4b611fda0a1c304bb8ad96922"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5a890539_3d1ab217","line":14,"updated":"2014-11-20 13:37:56.000000000","message":"ditto","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"56d0373f33ac7b8b80677b26794086638bb413fb","unresolved":false,"context_lines":[{"line_number":11,"context_line":"But exception would still occured with the operation of db.collection.find() function."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch can give some benifit to tolerance DB restart with find() function."},{"line_number":14,"context_line":"Since ceilometer mostly use \"yield\" to get each find() element, we can only except the"},{"line_number":15,"context_line":"\"AutoReconnect\" exceptions in \"yield\" functions."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ia0474726960ce2b4b611fda0a1c304bb8ad96922"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5a890539_e195c5e4","line":14,"in_reply_to":"5a890539_3d1ab217","updated":"2014-11-21 06:16:09.000000000","message":"Done","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"398ab5d5bb1b28cb4bca19420732a631afda23c2","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     lqslan \u003clqslan@cn.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-11-21 14:13:53 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Retry to connect database when DB2 or mongodb is restart"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch https://review.openstack.org/#/c/122387 works fine"},{"line_number":10,"context_line":"with operations with get, record and update functions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_c0108750","line":7,"range":{"start_line":7,"start_character":49,"end_line":7,"end_character":56},"updated":"2014-11-24 14:05:14.000000000","message":"restarted :)","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"398ab5d5bb1b28cb4bca19420732a631afda23c2","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch https://review.openstack.org/#/c/122387 works fine"},{"line_number":10,"context_line":"with operations with get, record and update functions."},{"line_number":11,"context_line":"But exception would still occured with the operation of"},{"line_number":12,"context_line":"db.collection.find() function."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch can give some benifit to tolerance DB restart"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5a890539_402c9799","line":11,"range":{"start_line":11,"start_character":26,"end_line":11,"end_character":33},"updated":"2014-11-24 14:05:14.000000000","message":"occur","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"042888de4b371d9d2b53ad4a6ec7b86f2f32fa5b","unresolved":false,"context_lines":[{"line_number":11,"context_line":"But exception would still occured with the operation of"},{"line_number":12,"context_line":"db.collection.find() function."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch can give some benifit to tolerance DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"It doesn\u0027t raise AutoReconnect exception at all."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5a890539_d471a045","line":14,"updated":"2014-11-28 13:38:46.000000000","message":"nit: s/tolerance/tolerate/","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"66e499dc51e74387435c3e0dcec528e865a27863","unresolved":false,"context_lines":[{"line_number":11,"context_line":"But exception would still occured with the operation of"},{"line_number":12,"context_line":"db.collection.find() function."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch can give some benifit to tolerance DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"It doesn\u0027t raise AutoReconnect exception at all."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5a890539_88d618c2","line":14,"in_reply_to":"5a890539_d471a045","updated":"2014-11-28 14:31:28.000000000","message":"Done","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"042888de4b371d9d2b53ad4a6ec7b86f2f32fa5b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"This patch can give some benifit to tolerance DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"It doesn\u0027t raise AutoReconnect exception at all."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ia0474726960ce2b4b611fda0a1c304bb8ad96922"},{"line_number":20,"context_line":"Closes-Bug: #1389985"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5a890539_54869014","line":17,"updated":"2014-11-28 13:38:46.000000000","message":"nit: s/It/it/","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"66e499dc51e74387435c3e0dcec528e865a27863","unresolved":false,"context_lines":[{"line_number":14,"context_line":"This patch can give some benifit to tolerance DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"It doesn\u0027t raise AutoReconnect exception at all."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ia0474726960ce2b4b611fda0a1c304bb8ad96922"},{"line_number":20,"context_line":"Closes-Bug: #1389985"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5a890539_a8e3d4a2","line":17,"in_reply_to":"5a890539_54869014","updated":"2014-11-28 14:31:28.000000000","message":"Done","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"9a05d4fa3691a9faab693a64a7736c07808e50dd","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     lqslan \u003clqslan@cn.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-11-28 22:21:41 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Retry to connect database when DB2 or mongodb is restart"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch https://review.openstack.org/#/c/122387 works fine"},{"line_number":10,"context_line":"with operations with get, record and update functions."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5a890539_6971c976","line":7,"range":{"start_line":7,"start_character":49,"end_line":7,"end_character":56},"updated":"2014-12-04 11:51:53.000000000","message":"restarted :)","commit_id":"69bff8d467a0d28517f68802da7d932bacce1043"},{"author":{"_account_id":8992,"name":"Billy Olsen","email":"billy.olsen@canonical.com","username":"billy-olsen"},"change_message_id":"786943b4a9b6ff20ed40ec5f44f86d391bd88d30","unresolved":false,"context_lines":[{"line_number":11,"context_line":"But exception would still occured with the operation of"},{"line_number":12,"context_line":"db.collection.find() function."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch can give some benifit to tolerate DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"it doesn\u0027t raise AutoReconnect exception at all."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5a890539_11183ed2","line":14,"updated":"2014-12-02 20:59:54.000000000","message":"Typo: benifit should be benefit","commit_id":"69bff8d467a0d28517f68802da7d932bacce1043"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"9a05d4fa3691a9faab693a64a7736c07808e50dd","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch can give some benifit to tolerate DB restart"},{"line_number":15,"context_line":"with find() function."},{"line_number":16,"context_line":"This patch also remove \"test_mongo_find\" test case since"},{"line_number":17,"context_line":"it doesn\u0027t raise AutoReconnect exception at all."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ia0474726960ce2b4b611fda0a1c304bb8ad96922"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5a890539_89f355e6","line":16,"range":{"start_line":16,"start_character":16,"end_line":16,"end_character":22},"updated":"2014-12-04 11:51:53.000000000","message":"removes","commit_id":"69bff8d467a0d28517f68802da7d932bacce1043"}],"ceilometer/alarm/storage/pymongo_base.py":[{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"afab8b0e65de3f205987684b5bdc21ea8e48da4c","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        else:"},{"line_number":201,"context_line":"            alarms \u003d self.db.alarm.find(query_filter, sort\u003dorderby)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        while True:"},{"line_number":204,"context_line":"            try:"},{"line_number":205,"context_line":"                attempts \u003d 0"},{"line_number":206,"context_line":"                for alarm in alarms:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_1906f320","line":203,"updated":"2014-11-20 09:27:04.000000000","message":"with the while cycle we will have all the data from very beginning every time when exception raise. amirignt? I guess if there a possibility to handle cursor objects separately in MongoProxy class? Because now you have proposed to many copy past code with a not straightforward  logic, I prefer not to duplicate data that function have already returned.","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"52f3529c1f274af5a1f5950722e3dc2556bd8cb6","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        else:"},{"line_number":201,"context_line":"            alarms \u003d self.db.alarm.find(query_filter, sort\u003dorderby)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        while True:"},{"line_number":204,"context_line":"            try:"},{"line_number":205,"context_line":"                attempts \u003d 0"},{"line_number":206,"context_line":"                for alarm in alarms:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_545e82ea","line":203,"in_reply_to":"5a890539_1906f320","updated":"2014-11-20 09:39:03.000000000","message":"Hi Igor, thanks for your time. I can\u0027t find a suitable way to handle cursor objects in MongoProxy class.  Catch the AutoReconnect exception in each functions seems to be the only way in my opinion. Could you give me some tips about how to handle it separately ?","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"}],"ceilometer/storage/mongo/utils.py":[{"author":{"_account_id":7729,"name":"Ilya Tyaptin","email":"ityaptin@mirantis.com","username":"ityaptin"},"change_message_id":"1578917d70383ba42d5b5e96bd03bdb22b95014a","unresolved":false,"context_lines":[{"line_number":341,"context_line":""},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"def retry_on_database_error(attempts, err):"},{"line_number":344,"context_line":"    \"\"\"Retry if AutoReconnect occurred when iterate the Cursor"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    :param attempts: attempts of retry"},{"line_number":347,"context_line":"    :param err: the object of error"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_9d0806db","line":344,"updated":"2014-11-20 13:37:56.000000000","message":"First docstring line should to end with \".\"","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"56d0373f33ac7b8b80677b26794086638bb413fb","unresolved":false,"context_lines":[{"line_number":341,"context_line":""},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"def retry_on_database_error(attempts, err):"},{"line_number":344,"context_line":"    \"\"\"Retry if AutoReconnect occurred when iterate the Cursor"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    :param attempts: attempts of retry"},{"line_number":347,"context_line":"    :param err: the object of error"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_0199f11e","line":344,"in_reply_to":"5a890539_9d0806db","updated":"2014-11-21 06:16:09.000000000","message":"Done, Many thanks!","commit_id":"e09f3c88c683832f356985af901e5c4bb759d089"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"a3ad5207a5ce611ef93d5fea65accdd3fd6d47d3","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"def safe_mongo_call(call):"},{"line_number":321,"context_line":"    def closure(*args, **kwargs):"},{"line_number":322,"context_line":"        max_retries \u003d 10"},{"line_number":323,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":324,"context_line":"        attempts \u003d 0"},{"line_number":325,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_01673126","line":322,"updated":"2014-11-21 06:23:35.000000000","message":"Change this line because \"cfg.CONF.database.max_retries\" will be override by follow line, if I am right.\nhttps://github.com/openstack/ceilometer/blob/master/ceilometer/storage/__init__.py#L99","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"7b938b7023bf92b5bd48852100f4a5d582ccb101","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"def safe_mongo_call(call):"},{"line_number":321,"context_line":"    def closure(*args, **kwargs):"},{"line_number":322,"context_line":"        max_retries \u003d 10"},{"line_number":323,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":324,"context_line":"        attempts \u003d 0"},{"line_number":325,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_dc1270b3","line":322,"in_reply_to":"5a890539_01673126","updated":"2014-11-21 07:39:21.000000000","message":"you definitely cannot change that param because it is configurable and cannot be hardcoded.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"398ab5d5bb1b28cb4bca19420732a631afda23c2","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"def safe_mongo_call(call):"},{"line_number":321,"context_line":"    def closure(*args, **kwargs):"},{"line_number":322,"context_line":"        max_retries \u003d 10"},{"line_number":323,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":324,"context_line":"        attempts \u003d 0"},{"line_number":325,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_c0ac07f0","line":322,"in_reply_to":"5a890539_d7a16baa","updated":"2014-11-24 14:05:14.000000000","message":"if so, issue should be fixed in the place you mentioned, not here actually. Or some other config option should be created and used here.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"0599d7bb403bd9e26cc87d2e2c2532f0f60702b0","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"def safe_mongo_call(call):"},{"line_number":321,"context_line":"    def closure(*args, **kwargs):"},{"line_number":322,"context_line":"        max_retries \u003d 10"},{"line_number":323,"context_line":"        retry_interval \u003d cfg.CONF.database.retry_interval"},{"line_number":324,"context_line":"        attempts \u003d 0"},{"line_number":325,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_d7a16baa","line":322,"in_reply_to":"5a890539_dc1270b3","updated":"2014-11-21 07:53:42.000000000","message":"I hardcorded it because cfg.CONF.database.max_retries has been override to \"0\"  at this line: https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/__init__.py#L99\n\"safe_mongo_call\" wouldn\u0027t retry if I didn\u0027t do the hardcode.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"7b938b7023bf92b5bd48852100f4a5d582ccb101","unresolved":false,"context_lines":[{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        if item in (\u0027name\u0027, \u0027database\u0027):"},{"line_number":378,"context_line":"            return getattr(self.conn, item)"},{"line_number":379,"context_line":"        if item \u003d\u003d \u0027find\u0027:"},{"line_number":380,"context_line":"            return getattr(Prefection(self.conn), item)"},{"line_number":381,"context_line":"        if item in MONGO_METHODS:"},{"line_number":382,"context_line":"            return MongoConn(getattr(self.conn, item))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_1c131867","line":379,"updated":"2014-11-21 07:39:21.000000000","message":"Why do you add that condition, could you explain it is not clear.\n\nPrefection is a class that change collection.find method when Client is initializing.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"0599d7bb403bd9e26cc87d2e2c2532f0f60702b0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        if item in (\u0027name\u0027, \u0027database\u0027):"},{"line_number":378,"context_line":"            return getattr(self.conn, item)"},{"line_number":379,"context_line":"        if item \u003d\u003d \u0027find\u0027:"},{"line_number":380,"context_line":"            return getattr(Prefection(self.conn), item)"},{"line_number":381,"context_line":"        if item in MONGO_METHODS:"},{"line_number":382,"context_line":"            return MongoConn(getattr(self.conn, item))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_779ef755","line":379,"in_reply_to":"5a890539_1c131867","updated":"2014-11-21 07:53:42.000000000","message":"If I didn\u0027t do this, collection.find would never call into the Perfection.find().  You can try it.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":3012,"name":"Dina Belova","email":"dbelova@mirantis.com","username":"dbelova"},"change_message_id":"398ab5d5bb1b28cb4bca19420732a631afda23c2","unresolved":false,"context_lines":[{"line_number":376,"context_line":"        \"\"\""},{"line_number":377,"context_line":"        if item in (\u0027name\u0027, \u0027database\u0027):"},{"line_number":378,"context_line":"            return getattr(self.conn, item)"},{"line_number":379,"context_line":"        if item \u003d\u003d \u0027find\u0027:"},{"line_number":380,"context_line":"            return getattr(Prefection(self.conn), item)"},{"line_number":381,"context_line":"        if item in MONGO_METHODS:"},{"line_number":382,"context_line":"            return MongoConn(getattr(self.conn, item))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_a0e7fb10","line":379,"in_reply_to":"5a890539_779ef755","updated":"2014-11-24 14:05:14.000000000","message":"hm, this is kind of really suspicious as due to the code, self.conn *already* contains Perfection.find.... May you please find the actual reason for the failure (and what kind of symptoms are you facing actually)?","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"7b938b7023bf92b5bd48852100f4a5d582ccb101","unresolved":false,"context_lines":[{"line_number":407,"context_line":"    def __getitem__(self, item):"},{"line_number":408,"context_line":"        return self.cursor[item]"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @safe_mongo_call"},{"line_number":411,"context_line":"    def next(self):"},{"line_number":412,"context_line":"        \"\"\"Wrap Cursor next function."},{"line_number":413,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_dc7990fd","line":410,"updated":"2014-11-21 07:39:21.000000000","message":"If you use decorator safe_mongo_call you do not need try block in next function, just \n@safe_mongo_call\ndef next(self):\n    return self.cursor.next()","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"0599d7bb403bd9e26cc87d2e2c2532f0f60702b0","unresolved":false,"context_lines":[{"line_number":407,"context_line":"    def __getitem__(self, item):"},{"line_number":408,"context_line":"        return self.cursor[item]"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"    @safe_mongo_call"},{"line_number":411,"context_line":"    def next(self):"},{"line_number":412,"context_line":"        \"\"\"Wrap Cursor next function."},{"line_number":413,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_57d1fbf9","line":410,"in_reply_to":"5a890539_dc7990fd","updated":"2014-11-21 07:53:42.000000000","message":"I used try here because I need restore the cursor see line#420  if AutoReconnect happened. Because the cursor.next() always return the next  different element.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"7b938b7023bf92b5bd48852100f4a5d582ccb101","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        else:"},{"line_number":423,"context_line":"            return result"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def __getattr__(self, item):"},{"line_number":426,"context_line":"        return getattr(self.cursor, item)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_5c25a0c0","line":425,"updated":"2014-11-21 07:39:21.000000000","message":"what attributes do we need from Cursor object?","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"0599d7bb403bd9e26cc87d2e2c2532f0f60702b0","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        else:"},{"line_number":423,"context_line":"            return result"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def __getattr__(self, item):"},{"line_number":426,"context_line":"        return getattr(self.cursor, item)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a890539_3702af6f","line":425,"in_reply_to":"5a890539_5c25a0c0","updated":"2014-11-21 07:53:42.000000000","message":"Many attributes need to get from \"getattr\"  such as cursor_id , retrived etc.","commit_id":"2efd4c21189490c9f930a7fa37b5458778fd0555"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"ee4c7668967614db71e2f9860722178671d8de55","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    def __init__(self, cursor):"},{"line_number":394,"context_line":"        self.cursor \u003d cursor"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def __getitem__(self, item):"},{"line_number":397,"context_line":"        return self.cursor[item]"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    @safe_mongo_call"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_d7166f48","line":396,"updated":"2014-11-25 11:23:36.000000000","message":"Not blocking question:\nit is seems that one case is still not be covered with reconnection, that is __getitem__ method that is used https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl_mongodb.py#L563 Of course it is a rare case but WDYT, can we cover either it?","commit_id":"d2c245590f8d2518491e549c63665dd0e8d9f6dd"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"fb7ca7ac9c0b4d3d1756f298d6dc74e5354f7728","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    def __init__(self, cursor):"},{"line_number":394,"context_line":"        self.cursor \u003d cursor"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def __getitem__(self, item):"},{"line_number":397,"context_line":"        return self.cursor[item]"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    @safe_mongo_call"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_6d9b2866","line":396,"in_reply_to":"5a890539_d7166f48","updated":"2014-11-25 12:40:26.000000000","message":"This is really a rare case, so I will not cover it in this patch as we discussed.","commit_id":"d2c245590f8d2518491e549c63665dd0e8d9f6dd"},{"author":{"_account_id":10987,"name":"Igor Degtiarov","username":"tovstun","inactive":true},"change_message_id":"ee4c7668967614db71e2f9860722178671d8de55","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        \"\"\""},{"line_number":405,"context_line":"        try:"},{"line_number":406,"context_line":"            save_cursor \u003d self.cursor.clone()"},{"line_number":407,"context_line":"            result \u003d self.cursor.next()"},{"line_number":408,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":409,"context_line":"            self.cursor \u003d save_cursor"},{"line_number":410,"context_line":"            raise err"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_54ea7d74","line":407,"updated":"2014-11-25 11:23:36.000000000","message":"refactor nit: line 407 could be written as:\nreturn self.cursor.next()\n\nSo lines 411-412 are not need","commit_id":"d2c245590f8d2518491e549c63665dd0e8d9f6dd"},{"author":{"_account_id":13273,"name":"Lena Novokshonova","email":"enovokshonova@mirantis.com","username":"enovokshonova"},"change_message_id":"01ae684bb7f7b204daeb5487c417dea409d1a8ac","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        \"\"\""},{"line_number":405,"context_line":"        try:"},{"line_number":406,"context_line":"            save_cursor \u003d self.cursor.clone()"},{"line_number":407,"context_line":"            result \u003d self.cursor.next()"},{"line_number":408,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":409,"context_line":"            self.cursor \u003d save_cursor"},{"line_number":410,"context_line":"            raise err"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_cdf09c93","line":407,"in_reply_to":"5a890539_54ea7d74","updated":"2014-11-25 12:44:39.000000000","message":"Agree with Igor, it will be better","commit_id":"d2c245590f8d2518491e549c63665dd0e8d9f6dd"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"fb7ca7ac9c0b4d3d1756f298d6dc74e5354f7728","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        \"\"\""},{"line_number":405,"context_line":"        try:"},{"line_number":406,"context_line":"            save_cursor \u003d self.cursor.clone()"},{"line_number":407,"context_line":"            result \u003d self.cursor.next()"},{"line_number":408,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":409,"context_line":"            self.cursor \u003d save_cursor"},{"line_number":410,"context_line":"            raise err"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_ada0b090","line":407,"in_reply_to":"5a890539_54ea7d74","updated":"2014-11-25 12:40:26.000000000","message":"Done, Thanks!","commit_id":"d2c245590f8d2518491e549c63665dd0e8d9f6dd"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"288ee123a7b7882c1e078a0cb6b2028c18437015","unresolved":false,"context_lines":[{"line_number":400,"context_line":"    def next(self):"},{"line_number":401,"context_line":"        \"\"\"Wrap Cursor next function."},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        This function will be executed before each Cursor next function call."},{"line_number":404,"context_line":"        \"\"\""},{"line_number":405,"context_line":"        try:"},{"line_number":406,"context_line":"            save_cursor \u003d self.cursor.clone()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_34fd846f","line":403,"updated":"2014-11-28 13:41:47.000000000","message":"very tiny nit: It seems this is a method rather than a function....... you can ignore this comment....","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"66e499dc51e74387435c3e0dcec528e865a27863","unresolved":false,"context_lines":[{"line_number":400,"context_line":"    def next(self):"},{"line_number":401,"context_line":"        \"\"\"Wrap Cursor next function."},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        This function will be executed before each Cursor next function call."},{"line_number":404,"context_line":"        \"\"\""},{"line_number":405,"context_line":"        try:"},{"line_number":406,"context_line":"            save_cursor \u003d self.cursor.clone()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_c8e02099","line":403,"in_reply_to":"5a890539_34fd846f","updated":"2014-11-28 14:31:28.000000000","message":"Done","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"042888de4b371d9d2b53ad4a6ec7b86f2f32fa5b","unresolved":false,"context_lines":[{"line_number":407,"context_line":"            return self.cursor.next()"},{"line_number":408,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":409,"context_line":"            self.cursor \u003d save_cursor"},{"line_number":410,"context_line":"            raise err"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    def __getattr__(self, item):"},{"line_number":413,"context_line":"        return getattr(self.cursor, item)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_d4fe00ae","line":410,"updated":"2014-11-28 13:38:46.000000000","message":"optional -1: use raise instead, because here is no log, so when err is raised, the stack trace is start from here, which is not so good FMPOV, if you do this, the L408 should be updated too","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"66e499dc51e74387435c3e0dcec528e865a27863","unresolved":false,"context_lines":[{"line_number":407,"context_line":"            return self.cursor.next()"},{"line_number":408,"context_line":"        except pymongo.errors.AutoReconnect as err:"},{"line_number":409,"context_line":"            self.cursor \u003d save_cursor"},{"line_number":410,"context_line":"            raise err"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    def __getattr__(self, item):"},{"line_number":413,"context_line":"        return getattr(self.cursor, item)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_e8ecfc94","line":410,"in_reply_to":"5a890539_d4fe00ae","updated":"2014-11-28 14:31:28.000000000","message":"Done","commit_id":"50b1dee8b896f5f8de9d7eda855f0eb54557f1a8"}],"ceilometer/tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"042888de4b371d9d2b53ad4a6ec7b86f2f32fa5b","unresolved":false,"context_lines":[{"line_number":3136,"context_line":""},{"line_number":3137,"context_line":"    @tests_db.run_with(\u0027mongodb\u0027)"},{"line_number":3138,"context_line":"    def test_mongo_client(self):"},{"line_number":3139,"context_line":"        if cfg.CONF.database.mongodb_replica_set:"},{"line_number":3140,"context_line":"            self.assertIsInstance(self.conn.conn.conn.conn,"},{"line_number":3141,"context_line":"                                  pymongo.MongoReplicaSetClient)"},{"line_number":3142,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_19c0c1df","side":"PARENT","line":3139,"updated":"2014-11-28 13:38:46.000000000","message":"I don\u0027t realize this issue in my own patch, sorry.\n\nThe problem is that the real configuration file will not be loaded when run test, we use a temporary/fake configuration file, so if we doesn\u0027t override this option in test code, then it will be default, which means in this test, it will always be the `else` branch.\n\nSo maybe we should remove this  test, or write another test class which will override that value in setup method.\n\nI can do this in my patch\n\nwhat\u0027s your opinion?","commit_id":"30824df1a40346bcab8e08f5647c1c2427a9f3f2"},{"author":{"_account_id":12927,"name":"Lan Qi song","email":"lqs933@foxmail.com","username":"lqisong"},"change_message_id":"66e499dc51e74387435c3e0dcec528e865a27863","unresolved":false,"context_lines":[{"line_number":3136,"context_line":""},{"line_number":3137,"context_line":"    @tests_db.run_with(\u0027mongodb\u0027)"},{"line_number":3138,"context_line":"    def test_mongo_client(self):"},{"line_number":3139,"context_line":"        if cfg.CONF.database.mongodb_replica_set:"},{"line_number":3140,"context_line":"            self.assertIsInstance(self.conn.conn.conn.conn,"},{"line_number":3141,"context_line":"                                  pymongo.MongoReplicaSetClient)"},{"line_number":3142,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_e8615c12","side":"PARENT","line":3139,"in_reply_to":"5a890539_19c0c1df","updated":"2014-11-28 14:31:28.000000000","message":"I understand what\u0027s your meaning about this problem. I would like to keep it in this patch and change it in your own patch. Thanks!","commit_id":"30824df1a40346bcab8e08f5647c1c2427a9f3f2"}]}
