)]}'
{"cinder/coordination.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"40c7f0ceef14a126fc1ba8098abf9555bd8bb988","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        lock \u003d Lock(lock_name, call_args, coordinator)"},{"line_number":291,"context_line":"        t1 \u003d timeutils.now()"},{"line_number":292,"context_line":"        t2 \u003d None"},{"line_number":293,"context_line":"        try:"},{"line_number":294,"context_line":"            with lock(blocking):"},{"line_number":295,"context_line":"                t2 \u003d timeutils.now()"},{"line_number":296,"context_line":"                LOG.debug(\u0027Lock \"%(name)s\" acquired by \"%(function)s\" :: \u0027"},{"line_number":297,"context_line":"                          \u0027waited %(wait_secs)0.3fs\u0027,"},{"line_number":298,"context_line":"                          {\u0027name\u0027: lock.name,"},{"line_number":299,"context_line":"                           \u0027function\u0027: f.__name__,"},{"line_number":300,"context_line":"                           \u0027wait_secs\u0027: (t2 - t1)})"},{"line_number":301,"context_line":"                return f(*a, **k)"},{"line_number":302,"context_line":"        finally:"},{"line_number":303,"context_line":"            t3 \u003d timeutils.now()"},{"line_number":304,"context_line":"            if t2 is None:"},{"line_number":305,"context_line":"                held_secs \u003d \"N/A\""},{"line_number":306,"context_line":"            else:"},{"line_number":307,"context_line":"                held_secs \u003d \"%0.3fs\" % (t3 - t2)"},{"line_number":308,"context_line":"            LOG.debug(\u0027Lock \"%(name)s\" released by \"%(function)s\" :: held \u0027"},{"line_number":309,"context_line":"                      \u0027%(held_secs)s\u0027,"},{"line_number":310,"context_line":"                      {\u0027name\u0027: lock.name,"},{"line_number":311,"context_line":"                       \u0027function\u0027: f.__name__,"},{"line_number":312,"context_line":"                       \u0027held_secs\u0027: held_secs})"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    return _synchronized"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a461143_2293d6a4","line":312,"range":{"start_line":293,"start_character":0,"end_line":312,"end_character":47},"updated":"2017-01-27 10:36:09.000000000","message":"If I get this correctly, if lock(blocking) will raise an exception, we\u0027ll print that lock was held without printing that it was acquired. Was it intentional for some reason?","commit_id":"f824bc05654756d93c70b6b25951ab5bc47376bb"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"6a577fda1183105f4d22c44ce901243312083a23","unresolved":false,"context_lines":[{"line_number":290,"context_line":"        lock \u003d Lock(lock_name, call_args, coordinator)"},{"line_number":291,"context_line":"        t1 \u003d timeutils.now()"},{"line_number":292,"context_line":"        t2 \u003d None"},{"line_number":293,"context_line":"        try:"},{"line_number":294,"context_line":"            with lock(blocking):"},{"line_number":295,"context_line":"                t2 \u003d timeutils.now()"},{"line_number":296,"context_line":"                LOG.debug(\u0027Lock \"%(name)s\" acquired by \"%(function)s\" :: \u0027"},{"line_number":297,"context_line":"                          \u0027waited %(wait_secs)0.3fs\u0027,"},{"line_number":298,"context_line":"                          {\u0027name\u0027: lock.name,"},{"line_number":299,"context_line":"                           \u0027function\u0027: f.__name__,"},{"line_number":300,"context_line":"                           \u0027wait_secs\u0027: (t2 - t1)})"},{"line_number":301,"context_line":"                return f(*a, **k)"},{"line_number":302,"context_line":"        finally:"},{"line_number":303,"context_line":"            t3 \u003d timeutils.now()"},{"line_number":304,"context_line":"            if t2 is None:"},{"line_number":305,"context_line":"                held_secs \u003d \"N/A\""},{"line_number":306,"context_line":"            else:"},{"line_number":307,"context_line":"                held_secs \u003d \"%0.3fs\" % (t3 - t2)"},{"line_number":308,"context_line":"            LOG.debug(\u0027Lock \"%(name)s\" released by \"%(function)s\" :: held \u0027"},{"line_number":309,"context_line":"                      \u0027%(held_secs)s\u0027,"},{"line_number":310,"context_line":"                      {\u0027name\u0027: lock.name,"},{"line_number":311,"context_line":"                       \u0027function\u0027: f.__name__,"},{"line_number":312,"context_line":"                       \u0027held_secs\u0027: held_secs})"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    return _synchronized"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a461143_52898d25","line":312,"range":{"start_line":293,"start_character":0,"end_line":312,"end_character":47},"in_reply_to":"3a461143_2293d6a4","updated":"2017-01-27 11:44:05.000000000","message":"I don\u0027t really follow your question... If lock acquisition raises an exception then it was never acquired, so it should not be logging that it acquired the log, and we\u0027ll print that it was held for N/A amount of time.\n\nWhile I would have preferred to change this to say that it failed to acquire the lock, I believe consistency in the log message with oslo concurrency synchronized is more important, since our code will have a mix of the 2 synchronized decorator depending on the needs of the specific code.","commit_id":"f824bc05654756d93c70b6b25951ab5bc47376bb"}]}
