)]}'
{"tooz/coordination.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"1201d71037d7034ced6a4c31540ead321229f09e","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    def get_lock(name):"},{"line_number":306,"context_line":"        \"\"\"Return a distributed lock."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        This is a exclusive lock, a second call to acquire() block or"},{"line_number":309,"context_line":"        return False."},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        :param name: The lock name that is used to identify it across all"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_586fe027","line":308,"updated":"2015-03-20 22:58:05.000000000","message":"\u0027to acquire() block\u0027 -\u003e \u0027to acquire() will block\u0027","commit_id":"80858b8201f70aa575f59590067fc25fa11dbfc7"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b747d24f05f5f8e1d0751b93c82d8d397f18af1e","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    def get_lock(name):"},{"line_number":306,"context_line":"        \"\"\"Return a distributed lock."},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        This is a exclusive lock, a second call to acquire() block or"},{"line_number":309,"context_line":"        return False."},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        :param name: The lock name that is used to identify it across all"}],"source_content_type":"text/x-python","patch_set":12,"id":"9aa53dc9_fe8f2b21","line":308,"in_reply_to":"9a80dd14_586fe027","updated":"2015-04-08 08:03:08.000000000","message":"Done","commit_id":"80858b8201f70aa575f59590067fc25fa11dbfc7"}],"tooz/drivers/file.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"86978edb04487f8bc286ce0d8878317c52e0ab50","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def release(self):"},{"line_number":61,"context_line":"        self.acquired \u003d False"},{"line_number":62,"context_line":"        self.unlock()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def lock(self):"},{"line_number":65,"context_line":"        raise NotImplementedError"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_3d7b792a","line":62,"updated":"2015-03-18 16:12:51.000000000","message":"So why the change of statements here (I understand the close one being removed)?\n\nIf unlocking fails (for whatever reason); then the lock is typically still acquired? But now with self.acquired\u003dFalse before unlock that\u0027s not true... Wonder if thats the best thing to do...","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b48c417d51a7c94bc34a2828563db00d31129505","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def release(self):"},{"line_number":61,"context_line":"        self.acquired \u003d False"},{"line_number":62,"context_line":"        self.unlock()"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def lock(self):"},{"line_number":65,"context_line":"        raise NotImplementedError"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_e644b7b9","line":62,"in_reply_to":"9a80dd14_3d7b792a","updated":"2015-03-19 16:56:31.000000000","message":"Mistake, acquired \u003d False must be after the unlock() otherwise that will not work.","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"}],"tooz/drivers/mysql.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9181d07f271832d02de9dc2670e9d91d0ff1cde5","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    NOTE(sileht): mysql allow only one lock per connection at a time:"},{"line_number":33,"context_line":"      select GET_LOCK(\"a\", 0);"},{"line_number":34,"context_line":"      select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def __init__(self, name, parsed_url, options):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_98903350","line":34,"updated":"2015-03-17 14:35:24.000000000","message":"Then don\u0027t you need to have a different connection per lock?","commit_id":"6fb7e8c8a63f75dad8ec7daefa2d13d13d573df4"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"2b003008b826a76810bc87f9ca205cb13de5514f","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    NOTE(sileht): mysql allow only one lock per connection at a time:"},{"line_number":33,"context_line":"      select GET_LOCK(\"a\", 0);"},{"line_number":34,"context_line":"      select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."},{"line_number":35,"context_line":"    \"\"\""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def __init__(self, name, parsed_url, options):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_3272fbad","line":34,"in_reply_to":"9a80dd14_98903350","updated":"2015-03-17 17:16:06.000000000","message":"That the case Line 39.","commit_id":"6fb7e8c8a63f75dad8ec7daefa2d13d13d573df4"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"86978edb04487f8bc286ce0d8878317c52e0ab50","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            #"},{"line_number":49,"context_line":"            # So, we track locally the lock status with self.acquired"},{"line_number":50,"context_line":"            if self.acquired is True:"},{"line_number":51,"context_line":"                if blocking:"},{"line_number":52,"context_line":"                    raise _retry.Retry"},{"line_number":53,"context_line":"                return False"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_7dfb3147","line":51,"updated":"2015-03-18 16:12:51.000000000","message":"I\u0027d be nice to use a condition variable (that is set when release happens, instead of a retry loop, but maybe something to change in another review...); that way u can just wait until some else releases and then try to acquire it, vs using the retry loop to do the same.","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"0419c9ea21bed321b963148b962e254ccaf7d16d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            # NOTE(sileht): mysql-server (\u003c5.7.5) allows only one lock per"},{"line_number":42,"context_line":"            # connection at a time:"},{"line_number":43,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":44,"context_line":"            #  select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."},{"line_number":45,"context_line":"            # Or"},{"line_number":46,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":47,"context_line":"            #  select GET_LOCK(\"a\", 0); release and lock again \"a\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a80dd14_9c3b2cd0","line":44,"updated":"2015-03-20 08:38:50.000000000","message":"I don\u0027t get how you fix that in that patch.\n\nIf a user request 2 locks, a and b, lock a and then b, lock on a is lost and then another tooz user can lock a.","commit_id":"90df46e2acec001dbab22ad7caa06b4b7408bbb5"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"1c37a86aa51d9e23ff834cb78bc028a2c4b1fbda","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            # NOTE(sileht): mysql-server (\u003c5.7.5) allows only one lock per"},{"line_number":42,"context_line":"            # connection at a time:"},{"line_number":43,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":44,"context_line":"            #  select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."},{"line_number":45,"context_line":"            # Or"},{"line_number":46,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":47,"context_line":"            #  select GET_LOCK(\"a\", 0); release and lock again \"a\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9a80dd14_b247391c","line":44,"in_reply_to":"9a80dd14_9c3b2cd0","updated":"2015-03-20 09:41:08.000000000","message":"A new connection is created for each lock line 33 and get_lock line 101 always return a new lock object.","commit_id":"90df46e2acec001dbab22ad7caa06b4b7408bbb5"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"379a410e6849894abac9db6b5c133f1c884475ee","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        @_retry.retry(stop_max_delay\u003dblocking)"},{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): mysql-server (\u003c5.7.5) allows only one lock per"},{"line_number":42,"context_line":"            # connection at a time:"},{"line_number":43,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":44,"context_line":"            #  select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_b8b37c98","line":41,"updated":"2015-03-20 23:04:05.000000000","message":"I\u0027d almost rather blowup on mysql \u003c 5.7.5\n\nSimilar to how the redis driver will not let certain operations occur on older redis versions it seems like we should have a similar thing here; avoid these edge-cases by just not letting this code be used in broken versions of mysql-server..\n\nThe following seems to exist, maybe we should just use it...\n\n  \u003e\u003e\u003e client \u003d pymysql.connect(user\u003d\u0027root\u0027)\n  \u003e\u003e\u003e c.server_version\n  u\u00275.x.y.z\u0027\n\n...","commit_id":"80858b8201f70aa575f59590067fc25fa11dbfc7"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"0eee44f64bc8ed1cc29ce965b0e3f770118ef785","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        @_retry.retry(stop_max_delay\u003dblocking)"},{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): mysql-server (\u003c5.7.5) allows only one lock per"},{"line_number":42,"context_line":"            # connection at a time:"},{"line_number":43,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":44,"context_line":"            #  select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6ced46_504d5d3d","line":41,"in_reply_to":"1a6ced46_c086f164","updated":"2015-03-25 15:32:44.000000000","message":"Ok, what a PITA, lol.","commit_id":"80858b8201f70aa575f59590067fc25fa11dbfc7"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"8e5da32cc689b531b7100e5ab6c227e92f38c344","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        @_retry.retry(stop_max_delay\u003dblocking)"},{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): mysql-server (\u003c5.7.5) allows only one lock per"},{"line_number":42,"context_line":"            # connection at a time:"},{"line_number":43,"context_line":"            #  select GET_LOCK(\"a\", 0);"},{"line_number":44,"context_line":"            #  select GET_LOCK(\"b\", 0); \u003c-- this release lock \"a\" ..."}],"source_content_type":"text/x-python","patch_set":12,"id":"1a6ced46_c086f164","line":41,"in_reply_to":"9a80dd14_b8b37c98","updated":"2015-03-25 07:56:58.000000000","message":"All this code is still needed because mysql \u003e\u003d 5.7.5 fix only the first example.","commit_id":"80858b8201f70aa575f59590067fc25fa11dbfc7"}],"tooz/drivers/pgsql.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9181d07f271832d02de9dc2670e9d91d0ff1cde5","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def __del__(self):"},{"line_number":140,"context_line":"        if self.acquired:"},{"line_number":141,"context_line":"            LOG.warn(\"unreleased lock %s garbage collected\" % self.name)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"class PostgresDriver(coordination.CoordinationDriver):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_b8c6d766","line":141,"updated":"2015-03-17 14:35:24.000000000","message":"I wonder if it should be an exception and common to all classes","commit_id":"6fb7e8c8a63f75dad8ec7daefa2d13d13d573df4"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"2b003008b826a76810bc87f9ca205cb13de5514f","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def __del__(self):"},{"line_number":140,"context_line":"        if self.acquired:"},{"line_number":141,"context_line":"            LOG.warn(\"unreleased lock %s garbage collected\" % self.name)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"class PostgresDriver(coordination.CoordinationDriver):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a80dd14_f734d5fc","line":141,"in_reply_to":"9a80dd14_b8c6d766","updated":"2015-03-17 17:16:06.000000000","message":"That useful only for driver that release lock when their resource are freed to warn developer that is have don\u0027t something wrong, perhaps we should add both LOG and exception. But exception in __del__ are just printed in stderr by the garbage collector, so...","commit_id":"6fb7e8c8a63f75dad8ec7daefa2d13d13d573df4"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"86978edb04487f8bc286ce0d8878317c52e0ab50","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            # so we track it internally if the process already has the lock."},{"line_number":108,"context_line":"            if self.acquired is True:"},{"line_number":109,"context_line":"                if blocking:"},{"line_number":110,"context_line":"                    raise _retry.Retry"},{"line_number":111,"context_line":"                return False"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            with _translating_cursor(self._conn) as cur:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_c07356b2","line":110,"updated":"2015-03-18 16:12:51.000000000","message":"I\u0027d be nice to use a condition variable (that is set when release happens, instead of a retry loop, but maybe something to change in another review...)","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b48c417d51a7c94bc34a2828563db00d31129505","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            # so we track it internally if the process already has the lock."},{"line_number":108,"context_line":"            if self.acquired is True:"},{"line_number":109,"context_line":"                if blocking:"},{"line_number":110,"context_line":"                    raise _retry.Retry"},{"line_number":111,"context_line":"                return False"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"            with _translating_cursor(self._conn) as cur:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_a6d0fff7","line":110,"in_reply_to":"9a80dd14_c07356b2","updated":"2015-03-19 16:56:31.000000000","message":"I have planned to replace all \u0027required\u0027 boolean be a condition, I will do that into an other patch for all drivers.","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"}],"tooz/drivers/zookeeper.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"db23a935abbe24bd45addb4bc71840c3a888e33b","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def release(self):"},{"line_number":61,"context_line":"        self._lock.release()"},{"line_number":62,"context_line":"        self.acquired \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class BaseZooKeeperDriver(coordination.CoordinationDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_631bc71c","line":62,"updated":"2015-03-17 18:12:10.000000000","message":"How does this work when acquired twice? The first release would then set self.acquired \u003d False; which is not really the case.","commit_id":"d052bf8bf3f001349fbd5e059154717350099332"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"355cfa90071a8b91d6e8a9d3a57af7842508318a","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def release(self):"},{"line_number":61,"context_line":"        self._lock.release()"},{"line_number":62,"context_line":"        self.acquired \u003d False"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"class BaseZooKeeperDriver(coordination.CoordinationDriver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a80dd14_76852cce","line":62,"in_reply_to":"9a80dd14_631bc71c","updated":"2015-03-18 06:32:11.000000000","message":"Tooz lock are exclusive and second call to acquire block (or return False) so this is safe. I have just move self.acquired \u003d False before self._lock.release() to ensure the concurrency safety on the release.\n\nI have added a bit of doc to clarify that.","commit_id":"d052bf8bf3f001349fbd5e059154717350099332"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"86978edb04487f8bc286ce0d8878317c52e0ab50","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): kazoo lock looks broken:"},{"line_number":42,"context_line":"            # https://github.com/python-zk/kazoo/issues/291"},{"line_number":43,"context_line":"            # so we track the exclusivity internally"},{"line_number":44,"context_line":"            if self.acquired is True:"},{"line_number":45,"context_line":"                if blocking:"},{"line_number":46,"context_line":"                    raise _retry.Retry"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_dd1a5d7b","line":43,"updated":"2015-03-18 16:12:51.000000000","message":"This will very soon blow-up with a runtime error instead of allowing a second acquire.","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"f8fc20ce9b20203c443d837dd9145b88952502f5","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): kazoo lock looks broken:"},{"line_number":42,"context_line":"            # https://github.com/python-zk/kazoo/issues/291"},{"line_number":43,"context_line":"            # so we track the exclusivity internally"},{"line_number":44,"context_line":"            if self.acquired is True:"},{"line_number":45,"context_line":"                if blocking:"},{"line_number":46,"context_line":"                    raise _retry.Retry"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_38517a30","line":43,"in_reply_to":"9a80dd14_86a05b43","updated":"2015-03-19 23:12:48.000000000","message":"https://github.com/python-zk/kazoo/pull/297","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"c833b3fad39924e5d3acb273761883fb17b8080b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        def _lock():"},{"line_number":41,"context_line":"            # NOTE(sileht): kazoo lock looks broken:"},{"line_number":42,"context_line":"            # https://github.com/python-zk/kazoo/issues/291"},{"line_number":43,"context_line":"            # so we track the exclusivity internally"},{"line_number":44,"context_line":"            if self.acquired is True:"},{"line_number":45,"context_line":"                if blocking:"},{"line_number":46,"context_line":"                    raise _retry.Retry"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_86a05b43","line":43,"in_reply_to":"9a80dd14_dd1a5d7b","updated":"2015-03-19 16:55:04.000000000","message":"We don\u0027t want a second acquire to work, we want it to block AFAIU. Like threading.Lock.","commit_id":"264abd6080d742690bac88ffb5f936cbcac91a86"}]}
