)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"d385156255597f5df94f1870960568fc25aeeefd","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Tooz locks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds support for external locks, based on"},{"line_number":10,"context_line":"tooz."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Depends-On: I0458c7e58eeaa9e2460e78e23e321e394f2bc633"},{"line_number":13,"context_line":"Change-Id: I52b8d0a05a3dbedc67f3725f9ba6d009b8d1858f"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"3a50d1a3_c950420d","line":10,"updated":"2015-07-27 13:10:10.000000000","message":"It would be great if you could add a little more to this commit message. Maybe explain why this change is necessary and go through what you had to add to implement it. Thanks!","commit_id":"e71ef3128750018e10ae9a49138559c6cac4e063"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"ab0d165fd88360fc8eecfb1d5bc9f5996404f7f3","unresolved":false,"context_lines":[{"line_number":11,"context_line":"c-vol service."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Implements: blueprint cinder-volume-active-active-ha"},{"line_number":16,"context_line":"Depends-On: I0458c7e58eeaa9e2460e78e23e321e394f2bc633"},{"line_number":17,"context_line":"Change-Id: I52b8d0a05a3dbedc67f3725f9ba6d009b8d1858f"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"3a50d1a3_9100d803","line":14,"updated":"2015-07-28 17:12:10.000000000","message":"Empty line here should be removed.","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"2c184d31aab2ef8574e1063510b0987870738bfd","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds support for external locks, based on"},{"line_number":10,"context_line":"tooz as a part of work required to achieve A/A HA in"},{"line_number":11,"context_line":"c-vol service."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: Gorka Eguileor \u003cgeguileo@redhat.com\u003e"},{"line_number":14,"context_line":"Implements: blueprint cinder-volume-active-active-ha"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"1a4dcd0f_6b31280b","line":11,"updated":"2015-08-04 08:32:12.000000000","message":"Good work for the Coordination part. But why you choose CinderObject to add lock_name \u0026 get_lock definitely deserves some comments. It would make it easier for people to understand your intention.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"}],"cinder/coordination.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"481fab0e9c79e582d61fdc7b4d142c6270824098","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import contextlib"},{"line_number":16,"context_line":"from functools import wraps"},{"line_number":17,"context_line":"import threading"},{"line_number":18,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_bce76bab","line":15,"updated":"2015-05-27 15:47:26.000000000","message":"Use six.wraps","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2d187e229e2eb895a30767df55be4d9467c78747","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import contextlib"},{"line_number":16,"context_line":"from functools import wraps"},{"line_number":17,"context_line":"import threading"},{"line_number":18,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_80ec202a","line":15,"in_reply_to":"7a016987_bce76bab","updated":"2015-05-28 10:49:16.000000000","message":"Done","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"481fab0e9c79e582d61fdc7b4d142c6270824098","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        if not self.started:"},{"line_number":59,"context_line":"            self._start()"},{"line_number":60,"context_line":"            if self.started:"},{"line_number":61,"context_line":"                t \u003d threading.Thread(target\u003dself._heartbeat)"},{"line_number":62,"context_line":"                t.daemon \u003d True"},{"line_number":63,"context_line":"                t.start()"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_3cdb7b1d","line":61,"updated":"2015-05-27 15:47:26.000000000","message":"Did u want this to be a greenthread or a real thread? If you want it to be a real thread (and eventlet is being used) this will require a little more code to make sure u get an actual real thread.\n\nI think u\u0027d need to use https://github.com/eventlet/eventlet/blob/master/eventlet/patcher.py#L167 and get the original \u0027threading\u0027 module and then use that; but u might want to test that to make sure that really works...","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2d187e229e2eb895a30767df55be4d9467c78747","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        if not self.started:"},{"line_number":59,"context_line":"            self._start()"},{"line_number":60,"context_line":"            if self.started:"},{"line_number":61,"context_line":"                t \u003d threading.Thread(target\u003dself._heartbeat)"},{"line_number":62,"context_line":"                t.daemon \u003d True"},{"line_number":63,"context_line":"                t.start()"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_a61294b2","line":61,"in_reply_to":"7a016987_3cdb7b1d","updated":"2015-05-28 10:49:16.000000000","message":"Thanks, will try that.","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"4600ce8de442de88a2bb1ec1340373b9325b2571","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self.coordinator is not None:"},{"line_number":109,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.warning(_LW(\u0027Using file lock.\u0027))"},{"line_number":112,"context_line":"            return lockutils.external_lock(name, self.prefix)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_1f1551e4","line":111,"updated":"2015-05-27 15:53:09.000000000","message":"Perhaps instead default the coordinator to use the following instead:\n\nhttp://docs.openstack.org/developer/tooz/developers.html#file","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2d187e229e2eb895a30767df55be4d9467c78747","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        if self.coordinator is not None:"},{"line_number":109,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"},{"line_number":110,"context_line":"        else:"},{"line_number":111,"context_line":"            LOG.warning(_LW(\u0027Using file lock.\u0027))"},{"line_number":112,"context_line":"            return lockutils.external_lock(name, self.prefix)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_60f3640b","line":111,"in_reply_to":"7a016987_1f1551e4","updated":"2015-05-28 10:49:16.000000000","message":"Done","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"481fab0e9c79e582d61fdc7b4d142c6270824098","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            coordinator \u003d coordinator or COORDINATOR"},{"line_number":124,"context_line":"            ext_lock \u003d coordinator.get_lock(name)"},{"line_number":125,"context_line":"            ext_lock.acquire()"},{"line_number":126,"context_line":"            try:"},{"line_number":127,"context_line":"                yield ext_lock"},{"line_number":128,"context_line":"            finally:"},{"line_number":129,"context_line":"                ext_lock.release()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_1ce0bf95","line":126,"updated":"2015-05-27 15:47:26.000000000","message":"Why do this vs:\n\n  with ext_lock:\n     yield ext_lock\n\nShouldn\u0027t the above work?","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2d187e229e2eb895a30767df55be4d9467c78747","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            coordinator \u003d coordinator or COORDINATOR"},{"line_number":124,"context_line":"            ext_lock \u003d coordinator.get_lock(name)"},{"line_number":125,"context_line":"            ext_lock.acquire()"},{"line_number":126,"context_line":"            try:"},{"line_number":127,"context_line":"                yield ext_lock"},{"line_number":128,"context_line":"            finally:"},{"line_number":129,"context_line":"                ext_lock.release()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_4323d2a7","line":126,"in_reply_to":"7a016987_1ce0bf95","updated":"2015-05-28 10:49:16.000000000","message":"It was based on oslo_concurrency code, but I do agree that code above is cleaner.","commit_id":"26d50b6e6b57258218b89340161d1c19cba887ff"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2be084c8287906110503175b86e188fa61735f1f","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        except coordination.ToozError:"},{"line_number":97,"context_line":"            LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":98,"context_line":"        finally:"},{"line_number":99,"context_line":"            self.started \u003d False"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_39a585a1","line":99,"updated":"2015-05-29 04:23:25.000000000","message":"Who/when is the thread started joined with via its join() method?","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"a7582f4511e016b21bbfe3c327a03c715d55f7e7","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        except coordination.ToozError:"},{"line_number":97,"context_line":"            LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":98,"context_line":"        finally:"},{"line_number":99,"context_line":"            self.started \u003d False"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_67a9cf8f","line":99,"in_reply_to":"7a016987_39a585a1","updated":"2015-06-01 14:59:53.000000000","message":"Good catch, but I don\u0027t think that stop will ever be used. Method removed.","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2be084c8287906110503175b86e188fa61735f1f","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"},{"line_number":103,"context_line":"            if not self.started:"},{"line_number":104,"context_line":"                # re-connect"},{"line_number":105,"context_line":"                self._start()"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                self.coordinator.heartbeat()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_79965d3f","line":104,"updated":"2015-05-29 04:23:25.000000000","message":"Hmmm, not sure I like this, why have the heartbeating thread also restart the coordinator? Seems like whoever calls the start() method should be responsible for that, and the thread shouldn\u0027t exist when start() fails...","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"749fd371e335c6de8935d820b20e1f0f6bfca06a","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"},{"line_number":103,"context_line":"            if not self.started:"},{"line_number":104,"context_line":"                # re-connect"},{"line_number":105,"context_line":"                self._start()"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                self.coordinator.heartbeat()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_99e359d9","line":104,"in_reply_to":"7a016987_79965d3f","updated":"2015-05-29 04:25:11.000000000","message":"Also if the _start continues to fail, this will just endless spew log messages out, just doesn\u0027t seem like the best thing to do.","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"a7582f4511e016b21bbfe3c327a03c715d55f7e7","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"},{"line_number":103,"context_line":"            if not self.started:"},{"line_number":104,"context_line":"                # re-connect"},{"line_number":105,"context_line":"                self._start()"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                self.coordinator.heartbeat()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_bde0fa26","line":104,"in_reply_to":"7a016987_79965d3f","updated":"2015-06-01 14:59:53.000000000","message":"It\u0027s based on ceilometer coordinator implementation, but now when I analyzed it again it doesn\u0027t really solve re-connection issue properly. I think it\u0027s easier to restart coordinator here when needed, rather than keep track of whether connection is still alive or not from outside of this class.\n\nStart method won\u0027t run heartbeat if connection initially failed.","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"a7582f4511e016b21bbfe3c327a03c715d55f7e7","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    def _heartbeat(self):"},{"line_number":102,"context_line":"        while self.coordinator:"},{"line_number":103,"context_line":"            if not self.started:"},{"line_number":104,"context_line":"                # re-connect"},{"line_number":105,"context_line":"                self._start()"},{"line_number":106,"context_line":"            try:"},{"line_number":107,"context_line":"                self.coordinator.heartbeat()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_fd79d22f","line":104,"in_reply_to":"7a016987_99e359d9","updated":"2015-06-01 14:59:53.000000000","message":"I can add reconnect backoff, or silence sequential error messages. Sooner or later broken connection will lead to exception when acquiring lock.","commit_id":"be62ac97e78d1be25c76bbb119acee03a2b23773"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"aa024be15414e36879a6caf9c20c2b6e7b3e99e2","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            self.backoff \u003d cfg.CONF.coordination.initial_reconnect_backoff"},{"line_number":89,"context_line":"            LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _reconnect(self):"},{"line_number":92,"context_line":"        self._start()"},{"line_number":93,"context_line":"        max_backoff \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":94,"context_line":"        while not self.started:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5afe65bd_e55d96ed","line":91,"updated":"2015-06-01 15:40:00.000000000","message":"Maybe return a boolean or something else from _start(); this will continue to reconnect even if there is no \u0027backend_url\u0027 which seems wasteful right?","commit_id":"f47d7fbfaa11a5f715c566b850123f266fc7c0f1"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"7f6cdbd8ad0107339a808d9774e7b511e2c32417","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            self.backoff \u003d cfg.CONF.coordination.initial_reconnect_backoff"},{"line_number":89,"context_line":"            LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _reconnect(self):"},{"line_number":92,"context_line":"        self._start()"},{"line_number":93,"context_line":"        max_backoff \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":94,"context_line":"        while not self.started:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5afe65bd_281dc366","line":91,"in_reply_to":"5afe65bd_e55d96ed","updated":"2015-06-01 15:51:46.000000000","message":"Nm, this seems ok, since the heartbeat thread will never be started if the initial start() doesn\u0027t work.","commit_id":"f47d7fbfaa11a5f715c566b850123f266fc7c0f1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7a4e60f8988cc950b81554f933734ec052d8741","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                 default\u003d60.0,"},{"line_number":47,"context_line":"                 help\u003d\u0027Maximum number of seconds between sequential \u0027"},{"line_number":48,"context_line":"                      \u0027reconnection retries.\u0027),"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"]"},{"line_number":51,"context_line":"cfg.CONF.register_opts(OPTS, group\u003d\u0027coordination\u0027)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_a791579b","line":49,"updated":"2015-07-14 12:25:37.000000000","message":"We should also add a lock expiration timeout: How long locks should be kept acquired without a heartbeat before expiration.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7a4e60f8988cc950b81554f933734ec052d8741","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":74,"context_line":"            else:"},{"line_number":75,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def _start(self):"},{"line_number":78,"context_line":"        member_id \u003d self.prefix + self.agent_id"},{"line_number":79,"context_line":"        self.coordinator \u003d coordination.get_coordinator("}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_a7bf17fa","line":76,"updated":"2015-07-14 12:25:37.000000000","message":"There should be a stop method as well.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f6291a24b8e76eefaa7a2ccd56e34322e60ec848","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":74,"context_line":"            else:"},{"line_number":75,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def _start(self):"},{"line_number":78,"context_line":"        member_id \u003d self.prefix + self.agent_id"},{"line_number":79,"context_line":"        self.coordinator \u003d coordination.get_coordinator("}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_79a2879c","line":76,"in_reply_to":"9a41bdd9_a7bf17fa","updated":"2015-07-17 15:03:21.000000000","message":"Done","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7a4e60f8988cc950b81554f933734ec052d8741","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_a74cf770","line":132,"updated":"2015-07-14 12:25:37.000000000","message":"This should allow passing following arguments:\n- Blocking/Timeout: Whether we should wait forever to acquire this lock, return immediately (acquired or not) or have a timeout.\n- Expiration timeout: How long these locks should be kept acquired without a heartbeat before expiration.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"1bc2807e40580963fd5ddfa96a7325e4f91b8316","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_a03f3824","line":132,"in_reply_to":"9a41bdd9_192fbbf7","updated":"2015-07-17 16:22:45.000000000","message":"Blocking/Timeout it is supported by Tooz, it\u0027s argument blocking, that can be set to True, False or any number of seconds (including float numbers).\n\nExpiration/Timeout is available in may of the drivers, like Redis.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f6291a24b8e76eefaa7a2ccd56e34322e60ec848","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_192fbbf7","line":132,"in_reply_to":"9a41bdd9_a74cf770","updated":"2015-07-17 15:03:21.000000000","message":"It would be great to have that, but both will be quite difficult to realize.\n* Blocking/Timeout: not supported by tooz nor internal locks\n* Expiration timeout: not supported by tooz","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7a4e60f8988cc950b81554f933734ec052d8741","unresolved":false,"context_lines":[{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"},{"line_number":136,"context_line":"            coordinator \u003d coordinator or COORDINATOR"},{"line_number":137,"context_line":"            ext_lock \u003d coordinator.get_lock(name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_4e8748d7","line":134,"updated":"2015-07-14 12:25:37.000000000","message":"Why is this lock here instead of doing it in the else right before `yield int_lock`?","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7c541ad9bb8be8fa552165e237c06adcaab86d05","unresolved":false,"context_lines":[{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"},{"line_number":136,"context_line":"            coordinator \u003d coordinator or COORDINATOR"},{"line_number":137,"context_line":"            ext_lock \u003d coordinator.get_lock(name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_f5712e45","line":134,"in_reply_to":"9a41bdd9_4e8748d7","updated":"2015-07-14 19:46:06.000000000","message":"I can answer myself, to block multiple calls from the same process, since we may be using the same COORDINATOR object.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f6291a24b8e76eefaa7a2ccd56e34322e60ec848","unresolved":false,"context_lines":[{"line_number":131,"context_line":"@contextlib.contextmanager"},{"line_number":132,"context_line":"def lock(name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":133,"context_line":"    int_lock \u003d lockutils.internal_lock(name, semaphores\u003dsemaphores)"},{"line_number":134,"context_line":"    with int_lock:"},{"line_number":135,"context_line":"        if external:"},{"line_number":136,"context_line":"            coordinator \u003d coordinator or COORDINATOR"},{"line_number":137,"context_line":"            ext_lock \u003d coordinator.get_lock(name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_002ce9a9","line":134,"in_reply_to":"9a41bdd9_f5712e45","updated":"2015-07-17 15:03:21.000000000","message":"Yup, exactly,","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f7a4e60f8988cc950b81554f933734ec052d8741","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            yield int_lock"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"def synchronized(lock_name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":148,"context_line":"    def wrap(f):"},{"line_number":149,"context_line":"        @six.wraps(f)"},{"line_number":150,"context_line":"        def wrapped(*a, **k):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_ce735814","line":147,"updated":"2015-07-14 12:25:37.000000000","message":"I would change the default to True, because most locks we\u0027ll be using will be inter-node locks.","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f6291a24b8e76eefaa7a2ccd56e34322e60ec848","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            yield int_lock"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"def synchronized(lock_name, external\u003dFalse, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":148,"context_line":"    def wrap(f):"},{"line_number":149,"context_line":"        @six.wraps(f)"},{"line_number":150,"context_line":"        def wrapped(*a, **k):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a41bdd9_a9e361a3","line":147,"in_reply_to":"9a41bdd9_ce735814","updated":"2015-07-17 15:03:21.000000000","message":"Done","commit_id":"8131e4724fa1070fc50605a03bdff908e424e706"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"0931f0a072993685b664988e95116bd8a86c42b8","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            try:"},{"line_number":69,"context_line":"                self._start()"},{"line_number":70,"context_line":"                self.started \u003d True"},{"line_number":71,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":72,"context_line":"                # of coroutine"},{"line_number":73,"context_line":"                self.ev \u003d eventlet.spawn("},{"line_number":74,"context_line":"                    lambda: tpool.execute(self.heartbeat)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a50d1a3_02bbcec5","line":71,"updated":"2015-07-18 22:57:22.000000000","message":"What about just using one of https://github.com/openstack/oslo.service/blob/master/oslo_service/loopingcall.py#L118 to do this instead of a raw greenthread?\n\nThat code will already call periodically so might as well use it? and then u can also stop the periodic work in a more graceful manner (and it also is commonly used elsewhere to)....\n\nAn example: http://paste.openstack.org/show/387341/","commit_id":"ab08e52fa0275d6b721641d0546a4116a8dfe728"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"090d989f9cf158adc035b719c071876ea137f4bd","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        @six.wraps(f)"},{"line_number":172,"context_line":"        def wrapped(*a, **k):"},{"line_number":173,"context_line":"            call_args \u003d inspect.getcallargs(f, *a, **k)"},{"line_number":174,"context_line":"            name \u003d lock_name.format(f_name\u003df.__name__, **call_args)"},{"line_number":175,"context_line":"            with lock(name, external, semaphores, coordinator):"},{"line_number":176,"context_line":"                return f(*a, **k)"},{"line_number":177,"context_line":"        return wrapped"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a41bdd9_609370fb","line":174,"updated":"2015-07-17 16:23:01.000000000","message":"I think this feature is a great addition, but you should add it to the docstring as well as the commit message.","commit_id":"ab08e52fa0275d6b721641d0546a4116a8dfe728"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return self.coordinator is not None"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def start(self):"},{"line_number":74,"context_line":"        \"\"\"Connect to coordination backend and start heartbeat\"\"\""},{"line_number":75,"context_line":"        if not self.started:"},{"line_number":76,"context_line":"            try:"},{"line_number":77,"context_line":"                self._start()"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_9987b3b4","line":74,"updated":"2015-07-28 12:38:10.000000000","message":"Missing period at the end of docstring: https://www.python.org/dev/peps/pep-0257/#one-line-docstrings","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return self.coordinator is not None"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def start(self):"},{"line_number":74,"context_line":"        \"\"\"Connect to coordination backend and start heartbeat\"\"\""},{"line_number":75,"context_line":"        if not self.started:"},{"line_number":76,"context_line":"            try:"},{"line_number":77,"context_line":"                self._start()"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_e5d2c8d0","line":74,"in_reply_to":"3a50d1a3_9987b3b4","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def stop(self):"},{"line_number":92,"context_line":"        \"\"\"Disconnect from coordination backend and stop heartbeat\"\"\""},{"line_number":93,"context_line":"        if not self.coordinator:"},{"line_number":94,"context_line":"            return"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_19c2c3e9","line":92,"updated":"2015-07-28 12:38:10.000000000","message":"Same here","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def stop(self):"},{"line_number":92,"context_line":"        \"\"\"Disconnect from coordination backend and stop heartbeat\"\"\""},{"line_number":93,"context_line":"        if not self.coordinator:"},{"line_number":94,"context_line":"            return"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_85dc24e5","line":92,"in_reply_to":"3a50d1a3_19c2c3e9","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        \"\"\"Return a distributed lock"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        :param name:"},{"line_number":112,"context_line":"            The lock name that is used to identify it across all nodes."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        if self.coordinator is not None:"},{"line_number":115,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_f9635718","line":112,"updated":"2015-07-28 12:38:10.000000000","message":"Why is this on another line and missing param type unlike line 59?","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        \"\"\"Return a distributed lock"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        :param name:"},{"line_number":112,"context_line":"            The lock name that is used to identify it across all nodes."},{"line_number":113,"context_line":"        \"\"\""},{"line_number":114,"context_line":"        if self.coordinator is not None:"},{"line_number":115,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_a5528065","line":112,"in_reply_to":"3a50d1a3_f9635718","updated":"2015-07-28 13:24:38.000000000","message":"Fixed","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        if self.coordinator is not None:"},{"line_number":115,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"},{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            raise exception.LockCreationFailed"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def heartbeat(self):"},{"line_number":120,"context_line":"        \"\"\"Coordinator heartbeat"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_e413ae63","line":117,"updated":"2015-07-28 12:38:10.000000000","message":"We should give a reason for the failure: \"Missing coordinator\"","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        if self.coordinator is not None:"},{"line_number":115,"context_line":"            return self.coordinator.get_lock(self.prefix + name)"},{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            raise exception.LockCreationFailed"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def heartbeat(self):"},{"line_number":120,"context_line":"        \"\"\"Coordinator heartbeat"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_2588b070","line":117,"in_reply_to":"3a50d1a3_e413ae63","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except coordination.ToozError:"},{"line_number":154,"context_line":"            LOG.exception(_LE(\u0027Error sending a heartbeat to coordination \u0027"},{"line_number":155,"context_line":"                              \u0027backend.\u0027))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _reconnect(self):"},{"line_number":158,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase\"\"\""},{"line_number":159,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_8473ca7f","line":156,"updated":"2015-07-28 12:38:10.000000000","message":"If you are returning True in line 148 you should do an explicit `return False` here.","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except coordination.ToozError:"},{"line_number":154,"context_line":"            LOG.exception(_LE(\u0027Error sending a heartbeat to coordination \u0027"},{"line_number":155,"context_line":"                              \u0027backend.\u0027))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _reconnect(self):"},{"line_number":158,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase\"\"\""},{"line_number":159,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_05833457","line":156,"in_reply_to":"3a50d1a3_8473ca7f","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                              \u0027backend.\u0027))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _reconnect(self):"},{"line_number":158,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase\"\"\""},{"line_number":159,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"},{"line_number":160,"context_line":"        cap \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":161,"context_line":"        backoff \u003d base \u003d cfg.CONF.coordination.initial_reconnect_backoff"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_240bd6d7","line":158,"updated":"2015-07-28 12:38:10.000000000","message":"Missing period.","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                              \u0027backend.\u0027))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def _reconnect(self):"},{"line_number":158,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase\"\"\""},{"line_number":159,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"},{"line_number":160,"context_line":"        cap \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":161,"context_line":"        backoff \u003d base \u003d cfg.CONF.coordination.initial_reconnect_backoff"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_854c2443","line":158,"in_reply_to":"3a50d1a3_240bd6d7","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                with ext_lock:"},{"line_number":199,"context_line":"                    yield ext_lock"},{"line_number":200,"context_line":"            except coordination.ToozError:"},{"line_number":201,"context_line":"                raise exception.LockingFailed"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            yield int_lock"},{"line_number":204,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_df0afb1f","line":201,"updated":"2015-07-28 12:38:10.000000000","message":"We should add failure information from ToozError to make it easier to debug.","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"ebf6b7d6f1f3554986eabec6758e50b5e5983d76","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                with ext_lock:"},{"line_number":199,"context_line":"                    yield ext_lock"},{"line_number":200,"context_line":"            except coordination.ToozError:"},{"line_number":201,"context_line":"                raise exception.LockingFailed"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            yield int_lock"},{"line_number":204,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_25667051","line":201,"in_reply_to":"3a50d1a3_df0afb1f","updated":"2015-07-28 13:24:38.000000000","message":"Done","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"class MultiLock(locking.Lock):"},{"line_number":182,"context_line":"    def __init__(self, locks, semaphores\u003dNone, coordinator\u003dNone):"},{"line_number":183,"context_line":"        super(MultiLock, self).__init__(str(id(self)))"},{"line_number":184,"context_line":"        if isinstance(locks, six.string_types):"},{"line_number":185,"context_line":"            locks \u003d {locks}"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_ab71e70d","line":182,"updated":"2015-07-28 16:54:45.000000000","message":"s/locks/lock_names","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            with lockutils.internal_lock(self.name,"},{"line_number":197,"context_line":"                                         semaphores\u003dself.semaphores):"},{"line_number":198,"context_line":"                assert len(self._acquired_locks) \u003d\u003d 0, \u0027already acquired\u0027"},{"line_number":199,"context_line":"                for l in self.locks:"},{"line_number":200,"context_line":"                    if isinstance(l, six.string_types):"},{"line_number":201,"context_line":"                        c_obj \u003d lock_data.get(l)"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_763182ec","line":198,"updated":"2015-07-28 16:54:45.000000000","message":"I\u0027m not sure we want an assert instead of raising a proper exception..","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                         semaphores\u003dself.semaphores):"},{"line_number":198,"context_line":"                assert len(self._acquired_locks) \u003d\u003d 0, \u0027already acquired\u0027"},{"line_number":199,"context_line":"                for l in self.locks:"},{"line_number":200,"context_line":"                    if isinstance(l, six.string_types):"},{"line_number":201,"context_line":"                        c_obj \u003d lock_data.get(l)"},{"line_number":202,"context_line":"                        if isinstance(c_obj, objects.CinderObject):"},{"line_number":203,"context_line":"                            l \u003d c_obj.get_lock()"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_b64cea42","line":200,"updated":"2015-07-28 16:54:45.000000000","message":"Shouldn\u0027t we raise a warning if they are not string types?","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                        if isinstance(c_obj, objects.CinderObject):"},{"line_number":203,"context_line":"                            l \u003d c_obj.get_lock()"},{"line_number":204,"context_line":"                        else:"},{"line_number":205,"context_line":"                            name \u003d l.format("},{"line_number":206,"context_line":"                                vol_prefix\u003dobjects.Volume.obj_name(),"},{"line_number":207,"context_line":"                                snap_prefix\u003dobjects.Snapshot.obj_name(),"},{"line_number":208,"context_line":"                                back_prefix\u003dobjects.Backup.obj_name(),"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_96668eb9","line":205,"updated":"2015-07-28 16:54:45.000000000","message":"I think formatting should be done on initialization, and acquire should not require us to pass formatting information.","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":258,"context_line":"    \"\"\"Synchronization decorator."},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    :param lock_names: Lock name(s)."},{"line_number":261,"context_line":"    :type lock_names: str or set of str"},{"line_number":262,"context_line":"    :param blocking: Whether lock should be blocking."},{"line_number":263,"context_line":"    :param semaphores: Container that provides semaphores to use when locking."},{"line_number":264,"context_line":"    :param coordinator: Coordinator class to use when creating external lock."}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_96ebeedb","line":261,"updated":"2015-07-28 16:54:45.000000000","message":"It will accept any iterator, not only a set of str.","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":"    If a lock has the same name as an argument of the function this method"},{"line_number":297,"context_line":"    will check if that argument is a CinderObject and use the get_lock method"},{"line_number":298,"context_line":"    from that object instead of crating a new one."},{"line_number":299,"context_line":"    \"\"\""},{"line_number":300,"context_line":"    def wrap(f):"},{"line_number":301,"context_line":"        @six.wraps(f)"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_4b05c377","line":298,"updated":"2015-07-28 16:54:45.000000000","message":"s/crating/creating\n\nThis was a typo in my patch.  ;-)","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f9dbf51a485dd349a718dcebf19f141b08a63d0f","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    for l in locks:"},{"line_number":276,"context_line":"        try:"},{"line_number":277,"context_line":"            ret \u003d l.release() and ret"},{"line_number":278,"context_line":"        except Exception as ex:"},{"line_number":279,"context_line":"            LOG.error(_LE(\u0027Releasing lock %(lock)s: %(ex)\u0027),"},{"line_number":280,"context_line":"                      {\u0027lock\u0027: l, \u0027ex\u0027: ex})"},{"line_number":281,"context_line":"    return ret"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a50d1a3_acd98424","line":278,"updated":"2015-07-30 19:04:34.000000000","message":"ret \u003d False","commit_id":"4e1fa74a0b28eb0b88a8494f486887d53958d46e"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f9dbf51a485dd349a718dcebf19f141b08a63d0f","unresolved":false,"context_lines":[{"line_number":354,"context_line":"            call_args \u003d inspect.getcallargs(f, *a, **k)"},{"line_number":355,"context_line":"            call_args[\u0027f_name\u0027] \u003d f.__name__"},{"line_number":356,"context_line":"            lock \u003d MultiLock(lock_names, call_args, coordinator)"},{"line_number":357,"context_line":"            try:"},{"line_number":358,"context_line":"                if lock.acquire(blocking):"},{"line_number":359,"context_line":"                    return f(*a, **k)"},{"line_number":360,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a50d1a3_d1726711","line":357,"updated":"2015-07-30 19:04:34.000000000","message":"I\u0027m trying to land a patch in Tooz to allow lock\u0027s context manager to accept the blocking argument, if that lands we\u0027ll be able to change this to:\n\n with lock(blocking):\n     return f(*a, **k)\n\nBut until then, this is great","commit_id":"4e1fa74a0b28eb0b88a8494f486887d53958d46e"},{"author":{"_account_id":17444,"name":"Jay.Shen","email":"shenhong09@huawei.com","username":"Jay.Shen"},"change_message_id":"36f929d1a9a0a92e312eea6f32aa4431a0489546","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 Intel"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_36dfaf3b","line":1,"updated":"2015-08-02 04:21:31.000000000","message":"All Rights Reserved.?","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 Intel"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_22193522","line":1,"in_reply_to":"3a50d1a3_36dfaf3b","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":17444,"name":"Jay.Shen","email":"shenhong09@huawei.com","username":"Jay.Shen"},"change_message_id":"36f929d1a9a0a92e312eea6f32aa4431a0489546","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import contextlib"},{"line_number":16,"context_line":"import inspect"},{"line_number":17,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a50d1a3_f6e147fd","line":14,"updated":"2015-08-02 04:21:31.000000000","message":"no total module description?","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import contextlib"},{"line_number":16,"context_line":"import inspect"},{"line_number":17,"context_line":"import random"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_421481e7","line":14,"in_reply_to":"3a50d1a3_f6e147fd","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"2c184d31aab2ef8574e1063510b0987870738bfd","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    :param str agent_id: Agent identifier"},{"line_number":62,"context_line":"    :param str prefix: Used to provide member identifier with a"},{"line_number":63,"context_line":"        meaningful prefix."},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def __init__(self, agent_id\u003dNone, prefix\u003d\u0027\u0027):"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_6b884823","line":63,"updated":"2015-08-04 08:32:12.000000000","message":"Hope here could add: coordination member id is prefix+agent_id. The information is important for those who want to create correct connection to tooz side.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    :param str agent_id: Agent identifier"},{"line_number":62,"context_line":"    :param str prefix: Used to provide member identifier with a"},{"line_number":63,"context_line":"        meaningful prefix."},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def __init__(self, agent_id\u003dNone, prefix\u003d\u0027\u0027):"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_02d99956","line":63,"in_reply_to":"1a4dcd0f_6b884823","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"2c184d31aab2ef8574e1063510b0987870738bfd","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.agent_id \u003d agent_id or str(uuid.uuid4())"},{"line_number":69,"context_line":"        self.started \u003d False"},{"line_number":70,"context_line":"        self.prefix \u003d prefix"},{"line_number":71,"context_line":"        self.ev \u003d None"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def is_active(self):"},{"line_number":74,"context_line":"        return self.coordinator is not None"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_8b527412","line":71,"updated":"2015-08-04 08:32:12.000000000","message":"I guess self.ev should be a private member self._ev.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.agent_id \u003d agent_id or str(uuid.uuid4())"},{"line_number":69,"context_line":"        self.started \u003d False"},{"line_number":70,"context_line":"        self.prefix \u003d prefix"},{"line_number":71,"context_line":"        self.ev \u003d None"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def is_active(self):"},{"line_number":74,"context_line":"        return self.coordinator is not None"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_c2de513d","line":71,"in_reply_to":"1a4dcd0f_8b527412","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            try:"},{"line_number":80,"context_line":"                self._start()"},{"line_number":81,"context_line":"                self.started \u003d True"},{"line_number":82,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":83,"context_line":"                # of coroutine"},{"line_number":84,"context_line":"                self.ev \u003d eventlet.spawn("},{"line_number":85,"context_line":"                    lambda: tpool.execute(self.heartbeat)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_d8b695f8","line":82,"updated":"2015-08-06 05:15:29.000000000","message":"I\u0027d still prefer u use https://github.com/openstack/oslo.service/blob/master/oslo_service/loopingcall.py#L135 instead of a raw greenthread.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"4ef7b955bfa6c969eb51a3a66a0c3d58bee3e4e9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            try:"},{"line_number":80,"context_line":"                self._start()"},{"line_number":81,"context_line":"                self.started \u003d True"},{"line_number":82,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":83,"context_line":"                # of coroutine"},{"line_number":84,"context_line":"                self.ev \u003d eventlet.spawn("},{"line_number":85,"context_line":"                    lambda: tpool.execute(self.heartbeat)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_58d1ce21","line":82,"in_reply_to":"1a4dcd0f_45eb2bdc","updated":"2015-08-07 15:25:38.000000000","message":"That\u0027s ok, we can fix that, this also uses greenthreads so its not like its any different right now ;)","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f8027619898c5476a4d37431b40be3a086b081c3","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            try:"},{"line_number":80,"context_line":"                self._start()"},{"line_number":81,"context_line":"                self.started \u003d True"},{"line_number":82,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":83,"context_line":"                # of coroutine"},{"line_number":84,"context_line":"                self.ev \u003d eventlet.spawn("},{"line_number":85,"context_line":"                    lambda: tpool.execute(self.heartbeat)"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa1b9901_faf96c4e","line":82,"in_reply_to":"1a4dcd0f_58d1ce21","updated":"2015-08-18 12:32:12.000000000","message":"If I\u0027m not mistaken tpool use original, non-patched threading.Thread instead of greenthreads.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            try:"},{"line_number":80,"context_line":"                self._start()"},{"line_number":81,"context_line":"                self.started \u003d True"},{"line_number":82,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":83,"context_line":"                # of coroutine"},{"line_number":84,"context_line":"                self.ev \u003d eventlet.spawn("},{"line_number":85,"context_line":"                    lambda: tpool.execute(self.heartbeat)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_45eb2bdc","line":82,"in_reply_to":"1a4dcd0f_d8b695f8","updated":"2015-08-07 15:13:49.000000000","message":"The problem with FixedIntervalLoopingCall is that it uses concurrent green threads, rather than parallel real threads. Therefore it\u0027s possible that longer task will cause locks to expire before heartbeat could be send.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        coordinator, self.coordinator \u003d self.coordinator, None"},{"line_number":100,"context_line":"        if self.ev:"},{"line_number":101,"context_line":"            self.ev.kill()"},{"line_number":102,"context_line":"            self.ev.wait()"},{"line_number":103,"context_line":"            self.ev \u003d None"},{"line_number":104,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_98cd6d87","line":101,"updated":"2015-08-06 05:15:29.000000000","message":"I still really don\u0027t like kill() being used here, if u use https://github.com/openstack/oslo.service/blob/master/oslo_service/loopingcall.py#L135 u don\u0027t need to do this and u can just call stop() on that...","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c14922b54ccef07c5f72039c9927db2c19ed6742","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            coordinator.stop()"},{"line_number":106,"context_line":"        except coordination.ToozError:"},{"line_number":107,"context_line":"            LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":108,"context_line":"        finally:"},{"line_number":109,"context_line":"            self.started \u003d False"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_983ecd26","line":107,"updated":"2015-08-06 05:19:20.000000000","message":"\u0027Error connecting to coordination backend\u0027 doesn\u0027t seem to make sense, this isn\u0027t in the start method. Maybe it should be \u0027Error stopping coordination backend\u0027?","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            coordinator.stop()"},{"line_number":106,"context_line":"        except coordination.ToozError:"},{"line_number":107,"context_line":"            LOG.exception(_LE(\u0027Error connecting to coordination backend.\u0027))"},{"line_number":108,"context_line":"        finally:"},{"line_number":109,"context_line":"            self.started \u003d False"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_62eadddc","line":107,"in_reply_to":"1a4dcd0f_983ecd26","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d55bb41e751e683384a77efdb6cbc93a53ce3611","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase.\"\"\""},{"line_number":163,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"},{"line_number":164,"context_line":"        cap \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":165,"context_line":"        backoff \u003d base \u003d cfg.CONF.coordination.initial_reconnect_backoff"},{"line_number":166,"context_line":"        while True:"},{"line_number":167,"context_line":"            try:"},{"line_number":168,"context_line":"                self._start()"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_b8fb897a","line":165,"updated":"2015-08-06 05:17:11.000000000","message":"suggestion, keep track of the reconnect attempt number and use it in the log statement, for example:\n\n  LOG.warning( _LW(\u0027Reconnect attempt %s failed. Next try in %.2fs\u0027), attempt, backoff)","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        \"\"\"Reconnect with jittered exponential backoff increase.\"\"\""},{"line_number":163,"context_line":"        LOG.info(_LI(\u0027Reconnecting to coordination backend.\u0027))"},{"line_number":164,"context_line":"        cap \u003d cfg.CONF.coordination.max_reconnect_backoff"},{"line_number":165,"context_line":"        backoff \u003d base \u003d cfg.CONF.coordination.initial_reconnect_backoff"},{"line_number":166,"context_line":"        while True:"},{"line_number":167,"context_line":"            try:"},{"line_number":168,"context_line":"                self._start()"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_82e5a909","line":165,"in_reply_to":"1a4dcd0f_b8fb897a","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self._lock \u003d threading.Lock()"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def _prepare_locks(self, lock_names, lock_data):"},{"line_number":227,"context_line":"        for name in lock_names:"},{"line_number":228,"context_line":"            if not isinstance(name, six.string_types):"},{"line_number":229,"context_line":"                raise AttributeError(_(\u0027Not a valid string: %s\u0027) % name)"},{"line_number":230,"context_line":"            c_obj \u003d lock_data.get(name)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_58bfe5a9","line":227,"updated":"2015-08-06 05:15:29.000000000","message":"I\u0027d also recommend using sorted(lock_names) so that the sequence is always the same even if different locks are given with names in different order, this will help avoid deadlock.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self._lock \u003d threading.Lock()"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def _prepare_locks(self, lock_names, lock_data):"},{"line_number":227,"context_line":"        for name in lock_names:"},{"line_number":228,"context_line":"            if not isinstance(name, six.string_types):"},{"line_number":229,"context_line":"                raise AttributeError(_(\u0027Not a valid string: %s\u0027) % name)"},{"line_number":230,"context_line":"            c_obj \u003d lock_data.get(name)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_42c24154","line":227,"in_reply_to":"1a4dcd0f_58bfe5a9","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        with self._lock:"},{"line_number":259,"context_line":"            return release_locks(self.locks)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"def acquire_locks(locks, **acquire_options):"},{"line_number":263,"context_line":"    \"\"\"Acquire multiple locks at once."},{"line_number":264,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_f8903145","line":261,"updated":"2015-08-06 05:15:29.000000000","message":"A piece of code that is pretty similar to this, maybe u could use something similar if u want:\n\nhttps://github.com/harlowja/fasteners/blob/master/fasteners/_utils.py#L30\n\nI think using that would make these 2 functions that much simpler imho.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        with self._lock:"},{"line_number":259,"context_line":"            return release_locks(self.locks)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"def acquire_locks(locks, **acquire_options):"},{"line_number":263,"context_line":"    \"\"\"Acquire multiple locks at once."},{"line_number":264,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_c25971fe","line":261,"in_reply_to":"1a4dcd0f_f8903145","updated":"2015-08-07 15:13:49.000000000","message":"Both functions were part of MultiLock, which is indeed quite similar to mentioned code, but I extracted it back here to make @geguileo (whose part of patch I merged here) work on dependent patches easier.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":288,"context_line":"def release_locks(locks):"},{"line_number":289,"context_line":"    \"\"\"Release multiple locks at once."},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"    :param sequence locks: Sequence of locks to acquire."},{"line_number":292,"context_line":"    :return: returns true if released (false if not)"},{"line_number":293,"context_line":"    :rtype: bool"},{"line_number":294,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_f8b7d1d5","line":291,"updated":"2015-08-06 05:15:29.000000000","message":"\u0027Sequence of locks to acquire.\u0027 -\u003e \u0027Sequence of locks to release.\u0027","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":288,"context_line":"def release_locks(locks):"},{"line_number":289,"context_line":"    \"\"\"Release multiple locks at once."},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"    :param sequence locks: Sequence of locks to acquire."},{"line_number":292,"context_line":"    :return: returns true if released (false if not)"},{"line_number":293,"context_line":"    :rtype: bool"},{"line_number":294,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_e28a6d1a","line":291,"in_reply_to":"1a4dcd0f_f8b7d1d5","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"92e63d9c88a3099172b93a17221de4f923051069","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    :return: returns true if released (false if not)"},{"line_number":293,"context_line":"    :rtype: bool"},{"line_number":294,"context_line":"    \"\"\""},{"line_number":295,"context_line":"    ret \u003d True"},{"line_number":296,"context_line":"    for l in locks:"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            ret \u003d l.release() and ret"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_78a501a0","line":295,"updated":"2015-08-06 05:15:29.000000000","message":"So this should probably be:\n\n  for l in reversed(locks)\n\nThat way the locks are released in the reverse order from which they were acquired which I think is the more expected manner right?","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"402ac30379363400d6b7ce3471bf841bf18a397a","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    :return: returns true if released (false if not)"},{"line_number":293,"context_line":"    :rtype: bool"},{"line_number":294,"context_line":"    \"\"\""},{"line_number":295,"context_line":"    ret \u003d True"},{"line_number":296,"context_line":"    for l in locks:"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            ret \u003d l.release() and ret"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_028e792d","line":295,"in_reply_to":"1a4dcd0f_78a501a0","updated":"2015-08-07 15:13:49.000000000","message":"Done","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2f6f593255a606c671905d9a20aea0eccf4079a8","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    Lock name can be formatted using Python format string syntax::"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        MultiLock("},{"line_number":206,"context_line":"            (\u0027{vol_prefix}-{vol.id}\u0027, \u0027{snap_prefix}-{snap[name]}\u0027),"},{"line_number":207,"context_line":"            {\u0027vol\u0027: ..., \u0027snap\u0027: ...}"},{"line_number":208,"context_line":"        )"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"fa1b9901_3ebb7877","line":206,"updated":"2015-08-22 15:46:47.000000000","message":"Its benefical to tell users that the locks will be acquired in sorted order, and they will be released in the reversed order.","commit_id":"5acaf699032f3eb8ca0befff30cd53b46cff2323"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"a3b48ffa08a4daaa59fa653a4eec962ec1feea00","unresolved":false,"context_lines":[{"line_number":236,"context_line":"    def _prepare_locks(self, lock_names, lock_data):"},{"line_number":237,"context_line":"        for name in sorted(lock_names):"},{"line_number":238,"context_line":"            if not isinstance(name, six.string_types):"},{"line_number":239,"context_line":"                raise AttributeError(_(\u0027Not a valid string: %s\u0027) % name)"},{"line_number":240,"context_line":"            c_obj \u003d lock_data.get(name)"},{"line_number":241,"context_line":"            if isinstance(c_obj, objects_base.CinderObject):"},{"line_number":242,"context_line":"                yield c_obj.get_lock()"}],"source_content_type":"text/x-python","patch_set":30,"id":"fa1b9901_3feee88b","line":239,"updated":"2015-08-24 15:14:20.000000000","message":"\".\" at EOL","commit_id":"b9a3dc2734d1d30c7ebba962e560f83cbd4d2be1"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"4ba5d5390d4d81998de3073e701b38441bc22ae2","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                self._ev \u003d eventlet.spawn("},{"line_number":93,"context_line":"                    lambda: tpool.execute(self.heartbeat))"},{"line_number":94,"context_line":"            except coordination.ToozError:"},{"line_number":95,"context_line":"                LOG.exception(_LE(\u0027Error starting coordination backend.\u0027))"},{"line_number":96,"context_line":"            else:"},{"line_number":97,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"da85f559_2a95613f","line":95,"updated":"2015-11-13 17:26:49.000000000","message":"shouldn\u0027t we raise here since this could put the usage of the coordination in a bad state ?   It failed to start, yet we might still try and use it ?","commit_id":"468a81b9cbc244fa6e99c89a404ff509cad2d561"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"96a342fdb5b825a60ade63fc8168a34a6470481b","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                self._ev \u003d eventlet.spawn("},{"line_number":93,"context_line":"                    lambda: tpool.execute(self.heartbeat))"},{"line_number":94,"context_line":"            except coordination.ToozError:"},{"line_number":95,"context_line":"                LOG.exception(_LE(\u0027Error starting coordination backend.\u0027))"},{"line_number":96,"context_line":"            else:"},{"line_number":97,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"ba8a016a_365b4730","line":95,"in_reply_to":"ba8a016a_bdfe6b36","updated":"2015-11-18 08:02:54.000000000","message":"Hmmm notifications on disconnect, hmmm. Possible (at least for zookeeper) since it can notify when this happens, other backends, umm not so much, since they don\u0027t retain a active connection to there backend provider.","commit_id":"468a81b9cbc244fa6e99c89a404ff509cad2d561"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b7f19ed3ad8e48a9d7650a9b3b64fcc5ca478366","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                self._ev \u003d eventlet.spawn("},{"line_number":93,"context_line":"                    lambda: tpool.execute(self.heartbeat))"},{"line_number":94,"context_line":"            except coordination.ToozError:"},{"line_number":95,"context_line":"                LOG.exception(_LE(\u0027Error starting coordination backend.\u0027))"},{"line_number":96,"context_line":"            else:"},{"line_number":97,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"ba8a016a_bdfe6b36","line":95,"in_reply_to":"da85f559_2a95613f","updated":"2015-11-17 12:15:55.000000000","message":"I agree. Apart from that we need some kind of notification that we\u0027ve disconnected/lost quorum. I\u0027ve work with harlowja to get that right.","commit_id":"468a81b9cbc244fa6e99c89a404ff509cad2d561"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                self._start()"},{"line_number":86,"context_line":"                self.started \u003d True"},{"line_number":87,"context_line":"                # TODO(dulek): Spawn heartbeating thread only when running"},{"line_number":88,"context_line":"                # backends needing it once Tooz with 240681 gets released."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":91,"context_line":"                # of coroutine."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_5db04e8a","line":88,"updated":"2015-12-07 21:05:27.000000000","message":"1.28.0 should have this now.","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                self._start()"},{"line_number":86,"context_line":"                self.started \u003d True"},{"line_number":87,"context_line":"                # TODO(dulek): Spawn heartbeating thread only when running"},{"line_number":88,"context_line":"                # backends needing it once Tooz with 240681 gets released."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"                # NOTE(bluex): Start heartbeat in separate thread instead"},{"line_number":91,"context_line":"                # of coroutine."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_aaca1f19","line":88,"in_reply_to":"7a740942_5db04e8a","updated":"2015-12-08 13:36:16.000000000","message":"Done","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        coordinator, self.coordinator \u003d self.coordinator, None"},{"line_number":106,"context_line":"        if self._ev:"},{"line_number":107,"context_line":"            self._ev.kill()"},{"line_number":108,"context_line":"            self._ev.wait()"},{"line_number":109,"context_line":"            self._ev \u003d None"},{"line_number":110,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_7d6bcaf1","line":107,"updated":"2015-12-07 21:05:27.000000000","message":"Killing seems bad, why kill. Just stop it using an event object...\n\nFor example:\n\n   def heartbeat(self):\n      while self.coordinator is not None and not self._dead.is_set():\n         \u003cdo stuff\u003e\n\n   def stop(self): \n      \u003cstuff\u003e\n      if self.coordinator is not None:\n         self.coordinator.stop()\n      self._dead.set()\n      if self._ev is not None:\n          self._ev.wait()\n      self._ev \u003d None\n      self.coordinator \u003d None\n      self.started \u003d False","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        coordinator, self.coordinator \u003d self.coordinator, None"},{"line_number":106,"context_line":"        if self._ev:"},{"line_number":107,"context_line":"            self._ev.kill()"},{"line_number":108,"context_line":"            self._ev.wait()"},{"line_number":109,"context_line":"            self._ev \u003d None"},{"line_number":110,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_6ad0b7c9","line":107,"in_reply_to":"7a740942_7d6bcaf1","updated":"2015-12-08 13:36:16.000000000","message":"Done","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            except coordination.ToozConnectionError:"},{"line_number":144,"context_line":"                self._reconnect()"},{"line_number":145,"context_line":"            else:"},{"line_number":146,"context_line":"                time.sleep(cfg.CONF.coordination.heartbeat)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _start(self):"},{"line_number":149,"context_line":"        member_id \u003d self.prefix + self.agent_id"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_9871e4aa","line":146,"updated":"2015-12-07 21:05:27.000000000","message":"Use the above self._dead.wait(cfg.CONF.coordination.heartbeat) to not have to wait until the elapsed time runs out to die...","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":143,"context_line":"            except coordination.ToozConnectionError:"},{"line_number":144,"context_line":"                self._reconnect()"},{"line_number":145,"context_line":"            else:"},{"line_number":146,"context_line":"                time.sleep(cfg.CONF.coordination.heartbeat)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _start(self):"},{"line_number":149,"context_line":"        member_id \u003d self.prefix + self.agent_id"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_2adf0fda","line":146,"in_reply_to":"7a740942_9871e4aa","updated":"2015-12-08 13:36:16.000000000","message":"Done","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                msg \u003d _LW(\u0027Reconnect attempt %(attempt)s failed. \u0027"},{"line_number":179,"context_line":"                          \u0027Next try in %(backoff).2fs.\u0027)"},{"line_number":180,"context_line":"                LOG.warning(msg, {\u0027attempt\u0027: attempt, \u0027backoff\u0027: backoff})"},{"line_number":181,"context_line":"                time.sleep(backoff)"},{"line_number":182,"context_line":"        LOG.info(_LI(\u0027Reconnected to coordination backend.\u0027))"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_d8a20cfd","line":181,"updated":"2015-12-07 21:05:27.000000000","message":"Don\u0027t use time.sleep, use self._dead.wait once u add that event attribute.","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                msg \u003d _LW(\u0027Reconnect attempt %(attempt)s failed. \u0027"},{"line_number":179,"context_line":"                          \u0027Next try in %(backoff).2fs.\u0027)"},{"line_number":180,"context_line":"                LOG.warning(msg, {\u0027attempt\u0027: attempt, \u0027backoff\u0027: backoff})"},{"line_number":181,"context_line":"                time.sleep(backoff)"},{"line_number":182,"context_line":"        LOG.info(_LI(\u0027Reconnected to coordination backend.\u0027))"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_4ada9be9","line":181,"in_reply_to":"7a740942_d8a20cfd","updated":"2015-12-08 13:36:16.000000000","message":"Done","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"ed272a97eb8bfdfeb9866306e01b7b1f995d07d1","unresolved":false,"context_lines":[{"line_number":185,"context_line":"COORDINATOR \u003d Coordinator(prefix\u003d\u0027cinder-\u0027)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"class Lock(locking.Lock):"},{"line_number":189,"context_line":"    \"\"\"Lock with multiple locks at once."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param str lock_name: Lock name(s)."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_98cd64b9","line":188,"updated":"2015-12-07 21:06:55.000000000","message":"Whats the point of this class anymore :-P","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":185,"context_line":"COORDINATOR \u003d Coordinator(prefix\u003d\u0027cinder-\u0027)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"class Lock(locking.Lock):"},{"line_number":189,"context_line":"    \"\"\"Lock with multiple locks at once."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param str lock_name: Lock name(s)."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_055004d3","line":188,"in_reply_to":"7a740942_98cd64b9","updated":"2015-12-08 13:36:16.000000000","message":"It exist only to allow locking fragments of code other than functions and make code a little bit cleaner.","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"class Lock(locking.Lock):"},{"line_number":189,"context_line":"    \"\"\"Lock with multiple locks at once."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param str lock_name: Lock name(s)."},{"line_number":192,"context_line":"    :param dict lock_data: Data for lock name formatting."},{"line_number":193,"context_line":"    :param coordinator: Coordinator class to use when creating lock."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_fde33aa2","line":190,"updated":"2015-12-07 21:05:27.000000000","message":"Does this still do multiple locks at once?\n\nLooks like it only does one now?","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"class Lock(locking.Lock):"},{"line_number":189,"context_line":"    \"\"\"Lock with multiple locks at once."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    :param str lock_name: Lock name(s)."},{"line_number":192,"context_line":"    :param dict lock_data: Data for lock name formatting."},{"line_number":193,"context_line":"    :param coordinator: Coordinator class to use when creating lock."}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_0a4493b4","line":190,"in_reply_to":"7a740942_fde33aa2","updated":"2015-12-08 13:36:16.000000000","message":"Fixed","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2bb1521d27bfe5a888ae670fe2e9423e6bf578c1","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            call_args \u003d inspect.getcallargs(f, *a, **k)"},{"line_number":285,"context_line":"            call_args[\u0027f_name\u0027] \u003d f.__name__"},{"line_number":286,"context_line":"            lock \u003d Lock(lock_name, call_args, coordinator)"},{"line_number":287,"context_line":"            with lock(blocking):"},{"line_number":288,"context_line":"                return f(*a, **k)"},{"line_number":289,"context_line":"        return wrapped"},{"line_number":290,"context_line":"    return wrap"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_b8eb8012","line":287,"updated":"2015-12-07 21:05:27.000000000","message":"Why would blocking even be an option here? Who would want to use it non-blocking, non-blocking IMHO is equivalent to not using the lock in the first place since there is no guarantee it will be gotten (and the function has no idea if it will or will not be since this is a decorator...)","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"62b1140bd515631afb361094d1d3a5d389c64833","unresolved":false,"context_lines":[{"line_number":284,"context_line":"            call_args \u003d inspect.getcallargs(f, *a, **k)"},{"line_number":285,"context_line":"            call_args[\u0027f_name\u0027] \u003d f.__name__"},{"line_number":286,"context_line":"            lock \u003d Lock(lock_name, call_args, coordinator)"},{"line_number":287,"context_line":"            with lock(blocking):"},{"line_number":288,"context_line":"                return f(*a, **k)"},{"line_number":289,"context_line":"        return wrapped"},{"line_number":290,"context_line":"    return wrap"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a740942_0b46d54e","line":287,"in_reply_to":"7a740942_b8eb8012","updated":"2015-12-08 13:36:16.000000000","message":"It also have timeout option and both non-blocking options raises exception when lock was not acquired (updated docstring to make it clear). As for why it\u0027s an option - if I remember correctly one of Gorka\u0027s patches needed it some time ago.","commit_id":"3f6c8e68ac7ce7a1c690dd8834fc51dd025c74bd"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"3874ffa12eba5ae588598c6b741e4a6ea366a622","unresolved":false,"context_lines":[{"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":"coordiantion_opts \u003d ["},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027backend_url\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027file://$state_path\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027The backend URL to use for distributed coordination.\u0027),"}],"source_content_type":"text/x-python","patch_set":39,"id":"7a740942_74bf1cd0","line":37,"updated":"2015-12-14 16:01:11.000000000","message":"s/coordiantion/coordination/","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2c710b5f18a476e21c1d7eb90ceb3817225396d4","unresolved":false,"context_lines":[{"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":"coordiantion_opts \u003d ["},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027backend_url\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027file://$state_path\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027The backend URL to use for distributed coordination.\u0027),"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a710552_597529c9","line":37,"in_reply_to":"7a740942_74bf1cd0","updated":"2015-12-15 14:15:17.000000000","message":"Done","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"3874ffa12eba5ae588598c6b741e4a6ea366a622","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def __init__(self, agent_id\u003dNone, prefix\u003d\u0027\u0027):"},{"line_number":72,"context_line":"        self.coordinator \u003d None"},{"line_number":73,"context_line":"        self.agent_id \u003d agent_id or str(uuid.uuid4())"},{"line_number":74,"context_line":"        self.started \u003d False"},{"line_number":75,"context_line":"        self.prefix \u003d prefix"},{"line_number":76,"context_line":"        self._ev \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"7a740942_f409cc31","line":73,"updated":"2015-12-14 16:01:11.000000000","message":"I think for py3 safety, it\u0027s recommended to use six.text_type instead of str().","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2c710b5f18a476e21c1d7eb90ceb3817225396d4","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def __init__(self, agent_id\u003dNone, prefix\u003d\u0027\u0027):"},{"line_number":72,"context_line":"        self.coordinator \u003d None"},{"line_number":73,"context_line":"        self.agent_id \u003d agent_id or str(uuid.uuid4())"},{"line_number":74,"context_line":"        self.started \u003d False"},{"line_number":75,"context_line":"        self.prefix \u003d prefix"},{"line_number":76,"context_line":"        self._ev \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a710552_74090c2c","line":73,"in_reply_to":"7a740942_f409cc31","updated":"2015-12-15 14:15:17.000000000","message":"I\u0027m not using unicode here, str(uuid.uuid4()) gives the same result on both py2 and py3.","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":17275,"name":"Nate Potter","email":"nathaniel.potter@intel.com","username":"npotter"},"change_message_id":"ed4d74f67e2151e2043a27a1d4599c1690043700","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            except coordination.ToozError:"},{"line_number":95,"context_line":"                LOG.exception(_LE(\u0027Error starting coordination backend.\u0027))"},{"line_number":96,"context_line":"                raise"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":39,"id":"7a740942_13a67253","line":97,"updated":"2015-12-10 20:41:14.000000000","message":"nit: This else shouldn\u0027t be necessary here, since the code won\u0027t reach this point if the exception is caught and raised. You could just put this log statement at the same indentation level as the try and except and I think it would be clearer.","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2c710b5f18a476e21c1d7eb90ceb3817225396d4","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            except coordination.ToozError:"},{"line_number":95,"context_line":"                LOG.exception(_LE(\u0027Error starting coordination backend.\u0027))"},{"line_number":96,"context_line":"                raise"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                LOG.info(_LI(\u0027Coordination backend started successfully.\u0027))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def stop(self):"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a710552_947358b1","line":97,"in_reply_to":"7a740942_13a67253","updated":"2015-12-15 14:15:17.000000000","message":"Done","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"58806782a8ceb885fc9e4982e9b94fe96e346647","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def stop(self):"},{"line_number":101,"context_line":"        \"\"\"Disconnect from coordination backend and stop heartbeat.\"\"\""},{"line_number":102,"context_line":"        self.coordinator.stop()"},{"line_number":103,"context_line":"        self._dead.set()"},{"line_number":104,"context_line":"        if self._ev is not None:"},{"line_number":105,"context_line":"            self._ev.wait()"}],"source_content_type":"text/x-python","patch_set":39,"id":"7a740942_b13433fb","line":102,"updated":"2015-12-10 22:42:08.000000000","message":"Do u want to add additional checks to not do things if start() wasn\u0027t called. Because otherwise there will be a bunch of failures that will happen if stop is called and start wasn\u0027t","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2c710b5f18a476e21c1d7eb90ceb3817225396d4","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def stop(self):"},{"line_number":101,"context_line":"        \"\"\"Disconnect from coordination backend and stop heartbeat.\"\"\""},{"line_number":102,"context_line":"        self.coordinator.stop()"},{"line_number":103,"context_line":"        self._dead.set()"},{"line_number":104,"context_line":"        if self._ev is not None:"},{"line_number":105,"context_line":"            self._ev.wait()"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a710552_9481184d","line":102,"in_reply_to":"7a740942_b13433fb","updated":"2015-12-15 14:15:17.000000000","message":"Good catch, thanks. Fixed","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":7350,"name":"Jordan Pittier","email":"jordan.pittier@gmail.com","username":"JordanP"},"change_message_id":"0fe431024521eb91a0cd7e4603b7d3f76c2d06ca","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        \"\"\"Coordinator heartbeat."},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        Method that every couple of seconds (config: `coordination.heartbeat`)"},{"line_number":125,"context_line":"        sends heartbeat to proof that the member is not dead."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        If connection to coordination backend is broken it tries to"},{"line_number":128,"context_line":"        reconnect every couple of seconds"}],"source_content_type":"text/x-python","patch_set":39,"id":"7a740942_18b29f06","line":125,"updated":"2015-12-14 13:12:13.000000000","message":"to prove","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"2c710b5f18a476e21c1d7eb90ceb3817225396d4","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        \"\"\"Coordinator heartbeat."},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        Method that every couple of seconds (config: `coordination.heartbeat`)"},{"line_number":125,"context_line":"        sends heartbeat to proof that the member is not dead."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        If connection to coordination backend is broken it tries to"},{"line_number":128,"context_line":"        reconnect every couple of seconds"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a710552_d43c8095","line":125,"in_reply_to":"7a740942_18b29f06","updated":"2015-12-15 14:15:17.000000000","message":"Done","commit_id":"32ffae4634bfed3cea26bac85f22c40b6da6c93f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"dbd0e912e4aa7b464f16e15faabadf084ee96f4c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"coordination_opts \u003d ["},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027backend_url\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027file://$state_path\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027The backend URL to use for distributed coordination.\u0027),"},{"line_number":41,"context_line":"    cfg.FloatOpt(\u0027heartbeat\u0027,"},{"line_number":42,"context_line":"                 default\u003d1.0,"}],"source_content_type":"text/x-python","patch_set":41,"id":"3a7e1126_9ee4f03b","line":39,"updated":"2015-12-17 06:48:48.000000000","message":"Hopefully in the future this changes, cause the file one ummm, isn\u0027t really distributed ;)\n\nGood for testing and CI and all that, but that\u0027s probably about as much as I would actually want to use this...","commit_id":"bd39299726859d452b05468851aa130ee61ddad2"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"df12bb84c4fe67409c4f290b76247de0144ee53a","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"coordination_opts \u003d ["},{"line_number":38,"context_line":"    cfg.StrOpt(\u0027backend_url\u0027,"},{"line_number":39,"context_line":"               default\u003d\u0027file://$state_path\u0027,"},{"line_number":40,"context_line":"               help\u003d\u0027The backend URL to use for distributed coordination.\u0027),"},{"line_number":41,"context_line":"    cfg.FloatOpt(\u0027heartbeat\u0027,"},{"line_number":42,"context_line":"                 default\u003d1.0,"}],"source_content_type":"text/x-python","patch_set":41,"id":"3a7e1126_61187585","line":39,"in_reply_to":"3a7e1126_9ee4f03b","updated":"2015-12-17 10:38:47.000000000","message":"Yup, I hope so. I chose file locks as default to keep it compatible with how it works now.","commit_id":"bd39299726859d452b05468851aa130ee61ddad2"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"dbd0e912e4aa7b464f16e15faabadf084ee96f4c","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def _prepare_lock(self, lock_name, lock_data):"},{"line_number":209,"context_line":"        if not isinstance(lock_name, six.string_types):"},{"line_number":210,"context_line":"            raise AttributeError(_(\u0027Not a valid string: %s\u0027) % lock_name)"},{"line_number":211,"context_line":"        return self.coordinator.get_lock(lock_name.format(**lock_data))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def acquire(self, blocking\u003dNone):"}],"source_content_type":"text/x-python","patch_set":41,"id":"3a7e1126_bea3ec9d","line":210,"updated":"2015-12-17 06:48:48.000000000","message":"Suggestion, use value error here, or type error, not attribute error as its the value of lock name that is actually bad, not an attribute of a object.","commit_id":"bd39299726859d452b05468851aa130ee61ddad2"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"df12bb84c4fe67409c4f290b76247de0144ee53a","unresolved":false,"context_lines":[{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def _prepare_lock(self, lock_name, lock_data):"},{"line_number":209,"context_line":"        if not isinstance(lock_name, six.string_types):"},{"line_number":210,"context_line":"            raise AttributeError(_(\u0027Not a valid string: %s\u0027) % lock_name)"},{"line_number":211,"context_line":"        return self.coordinator.get_lock(lock_name.format(**lock_data))"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    def acquire(self, blocking\u003dNone):"}],"source_content_type":"text/x-python","patch_set":41,"id":"3a7e1126_c169298d","line":210,"in_reply_to":"3a7e1126_bea3ec9d","updated":"2015-12-17 10:38:47.000000000","message":"Done","commit_id":"bd39299726859d452b05468851aa130ee61ddad2"}],"cinder/objects/base.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"2c184d31aab2ef8574e1063510b0987870738bfd","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def lock_name(self):"},{"line_number":72,"context_line":"        if \u0027id\u0027 not in self.fields:"},{"line_number":73,"context_line":"            raise NotImplementedError(_(\u0027VersionedObject is missing the id\u0027))"},{"line_number":74,"context_line":"        return self.obj_name() + \u0027-\u0027 + self.id"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_lock(self):"},{"line_number":77,"context_line":"        if not hasattr(self, \u0027lock\u0027):"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a4dcd0f_e8f8de7e","line":74,"updated":"2015-08-04 08:32:12.000000000","message":"I don\u0027t see the base class VersionedObject has self.id. Also, the error message \"VersionedObject is missing the id\" here makes it confusing that why VersionedObject is supposed to have an self.id. Good to add some comments.","commit_id":"9e7271654f6bf4039ac4a7684475ea8dc8615b7d"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"e2448cf89ea2a80e0baee88b452fc5b36bc6b33c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        return changes"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @property"},{"line_number":71,"context_line":"    def lock_name(self):"},{"line_number":72,"context_line":"        if \u0027id\u0027 not in self.fields:"},{"line_number":73,"context_line":"            raise NotImplementedError(_(\u0027VersionedObject is missing the id\u0027))"},{"line_number":74,"context_line":"        return self.obj_name() + \u0027-\u0027 + self.id"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a4dcd0f_c1b48b36","line":71,"updated":"2015-08-11 13:20:28.000000000","message":"Good if you can add some comments about why you choose CinderObject to put into lock mechanism.","commit_id":"af0a2a4440b3e9709d638b21f223ac9799b7d5b4"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"e9e60c618886ae35201aab3200a8938870da3e9e","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        return changes"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @property"},{"line_number":71,"context_line":"    def lock_name(self):"},{"line_number":72,"context_line":"        if \u0027id\u0027 not in self.fields:"},{"line_number":73,"context_line":"            raise NotImplementedError(_(\u0027VersionedObject is missing the id\u0027))"},{"line_number":74,"context_line":"        return self.obj_name() + \u0027-\u0027 + self.id"}],"source_content_type":"text/x-python","patch_set":25,"id":"fa1b9901_282c7701","line":71,"in_reply_to":"1a4dcd0f_c1b48b36","updated":"2015-08-18 14:00:14.000000000","message":"Done","commit_id":"af0a2a4440b3e9709d638b21f223ac9799b7d5b4"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"e2448cf89ea2a80e0baee88b452fc5b36bc6b33c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    @property"},{"line_number":71,"context_line":"    def lock_name(self):"},{"line_number":72,"context_line":"        if \u0027id\u0027 not in self.fields:"},{"line_number":73,"context_line":"            raise NotImplementedError(_(\u0027VersionedObject is missing the id\u0027))"},{"line_number":74,"context_line":"        return self.obj_name() + \u0027-\u0027 + self.id"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_lock(self):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a4dcd0f_818be31d","line":73,"updated":"2015-08-11 13:20:28.000000000","message":"The error message is confusing. Since `self.id` is actually not a member of CinderObject or VersionedObject. Would you change it to something like `__class__.__name__`?","commit_id":"af0a2a4440b3e9709d638b21f223ac9799b7d5b4"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"e9e60c618886ae35201aab3200a8938870da3e9e","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    @property"},{"line_number":71,"context_line":"    def lock_name(self):"},{"line_number":72,"context_line":"        if \u0027id\u0027 not in self.fields:"},{"line_number":73,"context_line":"            raise NotImplementedError(_(\u0027VersionedObject is missing the id\u0027))"},{"line_number":74,"context_line":"        return self.obj_name() + \u0027-\u0027 + self.id"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_lock(self):"}],"source_content_type":"text/x-python","patch_set":25,"id":"fa1b9901_08397341","line":73,"in_reply_to":"1a4dcd0f_818be31d","updated":"2015-08-18 14:00:14.000000000","message":"Done","commit_id":"af0a2a4440b3e9709d638b21f223ac9799b7d5b4"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"4ba5d5390d4d81998de3073e701b38441bc22ae2","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        if not hasattr(self, \u0027lock\u0027):"},{"line_number":86,"context_line":"            self._lock \u003d coordination.COORDINATOR.get_lock(self.lock_name)"},{"line_number":87,"context_line":"        return self._lock"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"class CinderObjectDictCompat(base.VersionedObjectDictCompat):"},{"line_number":91,"context_line":"    \"\"\"Mix-in to provide dictionary key access compat."}],"source_content_type":"text/x-python","patch_set":31,"id":"da85f559_8a100daa","line":88,"updated":"2015-11-13 17:26:49.000000000","message":"This seems like it should be a separate patch no?  To add locking to Cinder Objects.","commit_id":"468a81b9cbc244fa6e99c89a404ff509cad2d561"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"b7f19ed3ad8e48a9d7650a9b3b64fcc5ca478366","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        if not hasattr(self, \u0027lock\u0027):"},{"line_number":86,"context_line":"            self._lock \u003d coordination.COORDINATOR.get_lock(self.lock_name)"},{"line_number":87,"context_line":"        return self._lock"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"class CinderObjectDictCompat(base.VersionedObjectDictCompat):"},{"line_number":91,"context_line":"    \"\"\"Mix-in to provide dictionary key access compat."}],"source_content_type":"text/x-python","patch_set":31,"id":"ba8a016a_f17f4264","line":88,"in_reply_to":"da85f559_8a100daa","updated":"2015-11-17 12:15:55.000000000","message":"Done","commit_id":"468a81b9cbc244fa6e99c89a404ff509cad2d561"}],"cinder/tests/unit/test_coordination.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"090d989f9cf158adc035b719c071876ea137f4bd","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def release(self):"},{"line_number":40,"context_line":"        self.active_locks.remove(self.name)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@mock.patch(\u0027time.sleep\u0027, lambda _: None)"},{"line_number":44,"context_line":"@mock.patch(\u0027eventlet.spawn_n\u0027, lambda f: f())"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a41bdd9_2b8f8924","line":41,"updated":"2015-07-17 16:23:01.000000000","message":"This is missing tests for the new stop method as well as tests for the new functionality in syncrhonized decorator.","commit_id":"ab08e52fa0275d6b721641d0546a4116a8dfe728"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"468d9d91c6012cad1fea7b263295af2159afc2a0","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        self.assertIsNotNone(agent.coordinator)"},{"line_number":64,"context_line":"        agent.stop()"},{"line_number":65,"context_line":"        self.assertTrue(crd.stop.called)"},{"line_number":66,"context_line":"        self.assertIsNone(agent.coordinator)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def test_coordinator_lock(self, get_coordinator, heartbeat):"},{"line_number":69,"context_line":"        crd \u003d get_coordinator.return_value"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a50d1a3_1f538318","line":66,"updated":"2015-07-28 12:38:10.000000000","message":"Shouldn\u0027t we check that we are killing the heartbeat thread?","commit_id":"59cfcbab73c96fa6d871bf8c4d60caed8deb10e6"}],"cinder/volume/manager.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    \u0027cinder.volume.drivers.hds.iscsi.HDSISCSIDriver\u0027:"},{"line_number":124,"context_line":"    \u0027cinder.volume.drivers.hitachi.hnas_iscsi.HDSISCSIDriver\u0027}"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def locked_volume_operation(f):"},{"line_number":128,"context_line":"    \"\"\"Lock decorator for volume operations."},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_367a1af2","line":126,"updated":"2015-07-28 16:54:45.000000000","message":"This method should be removed","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        return lvo_inner2(inst, context, volume_id, **kwargs)"},{"line_number":145,"context_line":"    return lvo_inner1"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"def locked_detach_operation(f):"},{"line_number":149,"context_line":"    \"\"\"Lock decorator for volume detach operations."},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_f67fd2dc","line":147,"updated":"2015-07-28 16:54:45.000000000","message":"Remove","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"93a8e8e3c4a185a8260e9d6206eeb41b78d73e10","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        return ldo_inner2(inst, context, volume_id, attachment_id, **kwargs)"},{"line_number":164,"context_line":"    return ldo_inner1"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"def locked_snapshot_operation(f):"},{"line_number":168,"context_line":"    \"\"\"Lock decorator for snapshot operations."},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_9671ae0e","line":166,"updated":"2015-07-28 16:54:45.000000000","message":"Remove","commit_id":"b0638ce6a0c94ae17f082e255b5b6d86a9299965"}]}
