{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2759","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2759/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2759/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2759/events","html_url":"https://github.com/ManageIQ/manageiq/pull/2759","id":71368447,"number":2759,"title":"[WIP] Added additional lock debugging in broker.","user":{"login":"roliveri","id":2810177,"avatar_url":"https://avatars.githubusercontent.com/u/2810177?v=3","gravatar_id":"","url":"https://api.github.com/users/roliveri","html_url":"https://github.com/roliveri","followers_url":"https://api.github.com/users/roliveri/followers","following_url":"https://api.github.com/users/roliveri/following{/other_user}","gists_url":"https://api.github.com/users/roliveri/gists{/gist_id}","starred_url":"https://api.github.com/users/roliveri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roliveri/subscriptions","organizations_url":"https://api.github.com/users/roliveri/orgs","repos_url":"https://api.github.com/users/roliveri/repos","events_url":"https://api.github.com/users/roliveri/events{/privacy}","received_events_url":"https://api.github.com/users/roliveri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/WIP","name":"WIP","color":"eeeeee"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-27T18:44:31Z","updated_at":"2015-04-30T15:07:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/2759","html_url":"https://github.com/ManageIQ/manageiq/pull/2759","diff_url":"https://github.com/ManageIQ/manageiq/pull/2759.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/2759.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/97830489","html_url":"https://github.com/ManageIQ/manageiq/pull/2759#issuecomment-97830489","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/2759","id":97830489,"user":{"login":"jrafanie","id":19339,"avatar_url":"https://avatars.githubusercontent.com/u/19339?v=3","gravatar_id":"","url":"https://api.github.com/users/jrafanie","html_url":"https://github.com/jrafanie","followers_url":"https://api.github.com/users/jrafanie/followers","following_url":"https://api.github.com/users/jrafanie/following{/other_user}","gists_url":"https://api.github.com/users/jrafanie/gists{/gist_id}","starred_url":"https://api.github.com/users/jrafanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrafanie/subscriptions","organizations_url":"https://api.github.com/users/jrafanie/orgs","repos_url":"https://api.github.com/users/jrafanie/repos","events_url":"https://api.github.com/users/jrafanie/events{/privacy}","received_events_url":"https://api.github.com/users/jrafanie/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T15:07:56Z","updated_at":"2015-04-30T15:07:56Z","body":"Note, we found this yesterday:\r\n\r\nsync_changes_from_v1_9_3_551_to_v2_0_0_598:\r\n```diff\r\ndiff --git a/lib/sync.rb b/lib/sync.rb\r\nindex bae05a4..dc513fc 100644\r\n--- a/lib/sync.rb\r\n+++ b/lib/sync.rb\r\n@@ -45,8 +45,6 @@ end\r\n # A module that provides a two-phase lock with a counter.\r\n\r\n module Sync_m\r\n-  RCS_ID='-$Id$-'\r\n-\r\n   # lock mode\r\n   UN = :UN\r\n   SH = :SH\r\n@@ -137,19 +135,26 @@ module Sync_m\r\n\r\n   def sync_lock(m = EX)\r\n     return unlock if m == UN\r\n-\r\n-    while true\r\n-      @sync_mutex.synchronize do\r\n-        if sync_try_lock_sub(m)\r\n-          return self\r\n-        else\r\n-          if sync_sh_locker[Thread.current]\r\n-            sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]]\r\n-            sync_sh_locker.delete(Thread.current)\r\n-          else\r\n-            sync_waiting.push Thread.current\r\n+    Thread.handle_interrupt(StandardError => :on_blocking) do\r\n+      while true\r\n+        @sync_mutex.synchronize do\r\n+          begin\r\n+            if sync_try_lock_sub(m)\r\n+              return self\r\n+            else\r\n+              if sync_sh_locker[Thread.current]\r\n+                sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]]\r\n+                sync_sh_locker.delete(Thread.current)\r\n+              else\r\n+                unless sync_waiting.include?(Thread.current) || sync_upgrade_waiting.reverse_each.any?{|w| w.first == Thread.current }\r\n+                  sync_waiting.push Thread.current\r\n+                end\r\n+              end\r\n+              @sync_mutex.sleep\r\n+            end\r\n+          ensure\r\n+            sync_waiting.delete(Thread.current)\r\n           end\r\n-          @sync_mutex.sleep\r\n         end\r\n       end\r\n     end\r\n@@ -222,11 +227,13 @@ module Sync_m\r\n   end\r\n\r\n   def sync_synchronize(mode = EX)\r\n-    sync_lock(mode)\r\n-    begin\r\n-      yield\r\n-    ensure\r\n-      sync_unlock\r\n+    Thread.handle_interrupt(StandardError => :on_blocking) do\r\n+      sync_lock(mode)\r\n+      begin\r\n+        yield\r\n+      ensure\r\n+        sync_unlock\r\n+      end\r\n     end\r\n   end\r\n```"}}