)]}'
{"oslo/concurrency/lockutils.py":[{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"53e2c06ccf989f064f2d669a01dde0d66f4e4e45","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # Also upon reading the MSDN docs for locking(), it seems"},{"line_number":100,"context_line":"                # to have a laughable 10 attempts \"blocking\" mechanism."},{"line_number":101,"context_line":"                self.trylock()"},{"line_number":102,"context_line":"                self.t2 \u003d time.time()"},{"line_number":103,"context_line":"                LOG.debug(\u0027Acquired file lock \"%s\" after waiting %0.3fs\u0027,"},{"line_number":104,"context_line":"                          self.fname, (self.t2 - t1))"},{"line_number":105,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1ab92acc","line":102,"updated":"2014-10-24 00:32:50.000000000","message":"Do you need this to be self.t2? Wouldn\u0027t t2 suffice and also be marginally less expensive?","commit_id":"02e576c6595dfb483631bb462b5c945c4b4c15b1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"39011289ab4fe3c1bc9b6ae9b5536d7c95b00b87","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # Also upon reading the MSDN docs for locking(), it seems"},{"line_number":100,"context_line":"                # to have a laughable 10 attempts \"blocking\" mechanism."},{"line_number":101,"context_line":"                self.trylock()"},{"line_number":102,"context_line":"                self.t2 \u003d time.time()"},{"line_number":103,"context_line":"                LOG.debug(\u0027Acquired file lock \"%s\" after waiting %0.3fs\u0027,"},{"line_number":104,"context_line":"                          self.fname, (self.t2 - t1))"},{"line_number":105,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_1f8af469","line":102,"in_reply_to":"9aa7fdbe_1ab92acc","updated":"2014-10-24 08:59:57.000000000","message":"self.t2 is used in release()\n\nOtherwise having a more explicit name than t2 would be better :)","commit_id":"02e576c6595dfb483631bb462b5c945c4b4c15b1"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"318ccfe4cb3e9f74fc57fc1a7fff99affbfdcb2a","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                # Also upon reading the MSDN docs for locking(), it seems"},{"line_number":100,"context_line":"                # to have a laughable 10 attempts \"blocking\" mechanism."},{"line_number":101,"context_line":"                self.trylock()"},{"line_number":102,"context_line":"                self.t2 \u003d time.time()"},{"line_number":103,"context_line":"                LOG.debug(\u0027Acquired file lock \"%s\" after waiting %0.3fs\u0027,"},{"line_number":104,"context_line":"                          self.fname, (self.t2 - t1))"},{"line_number":105,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_10473ebd","line":102,"in_reply_to":"9aa7fdbe_1f8af469","updated":"2014-10-24 14:34:57.000000000","message":"I\u0027ll rename it.  I modelled this after the synchronized logging, but in that case they\u0027re all locals so the names aren\u0027t quite as important.","commit_id":"02e576c6595dfb483631bb462b5c945c4b4c15b1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"39011289ab4fe3c1bc9b6ae9b5536d7c95b00b87","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def release(self):"},{"line_number":125,"context_line":"        try:"},{"line_number":126,"context_line":"            t3 \u003d time.time()"},{"line_number":127,"context_line":"            LOG.debug(\u0027Releasing file lock \"%s\" after holding it for %0.3fs\u0027,"},{"line_number":128,"context_line":"                      self.fname, (t3 - self.t2))"},{"line_number":129,"context_line":"            self.unlock()"},{"line_number":130,"context_line":"        except IOError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5f80fc45","line":127,"updated":"2014-10-24 08:59:57.000000000","message":"Sounds to me it\u0027d be better to log after calling unlock()","commit_id":"02e576c6595dfb483631bb462b5c945c4b4c15b1"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"318ccfe4cb3e9f74fc57fc1a7fff99affbfdcb2a","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def release(self):"},{"line_number":125,"context_line":"        try:"},{"line_number":126,"context_line":"            t3 \u003d time.time()"},{"line_number":127,"context_line":"            LOG.debug(\u0027Releasing file lock \"%s\" after holding it for %0.3fs\u0027,"},{"line_number":128,"context_line":"                      self.fname, (t3 - self.t2))"},{"line_number":129,"context_line":"            self.unlock()"},{"line_number":130,"context_line":"        except IOError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_f0ae3a2d","line":127,"in_reply_to":"9aa7fdbe_5f80fc45","updated":"2014-10-24 14:34:57.000000000","message":"The concern with logging the release after it\u0027s already happened is that it\u0027s possible for a race to occur where another process comes in and grabs the lock between the unlock and the log.  That then makes it look like two threads held the same lock at the same time.\n\nA more egregious example of that behavior in the internal lock code led to https://bugs.launchpad.net/oslo.concurrency/+bug/1367941 and kind of prompted all of these logging cleanups in this code.\n\nIt\u0027s probably less of an issue with external locks, but I\u0027d still rather err on the side of caution.  We don\u0027t ever want to log something like\n\n A acquired\n B acquired\n A released\n B released","commit_id":"02e576c6595dfb483631bb462b5c945c4b4c15b1"}]}
