{"action":"created","issue":{"url":"https://api.github.com/repos/swanandp/acts_as_list/issues/235","repository_url":"https://api.github.com/repos/swanandp/acts_as_list","labels_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/235/comments","events_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/235/events","html_url":"https://github.com/swanandp/acts_as_list/issues/235","id":184114121,"number":235,"title":"PG::TRDeadlockDetected ","user":{"login":"seanarnold","id":693929,"avatar_url":"https://avatars.githubusercontent.com/u/693929?v=3","gravatar_id":"","url":"https://api.github.com/users/seanarnold","html_url":"https://github.com/seanarnold","followers_url":"https://api.github.com/users/seanarnold/followers","following_url":"https://api.github.com/users/seanarnold/following{/other_user}","gists_url":"https://api.github.com/users/seanarnold/gists{/gist_id}","starred_url":"https://api.github.com/users/seanarnold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanarnold/subscriptions","organizations_url":"https://api.github.com/users/seanarnold/orgs","repos_url":"https://api.github.com/users/seanarnold/repos","events_url":"https://api.github.com/users/seanarnold/events{/privacy}","received_events_url":"https://api.github.com/users/seanarnold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-20T01:27:58Z","updated_at":"2016-10-20T02:22:06Z","closed_at":null,"body":"We seem to intermittently get Deadlock errors with `acts_as_list` and Postgres. \r\n\r\n```\r\nPG::TRDeadlockDetected: ERROR: deadlock detected DETAIL: Process 18092 waits for ShareLock on transaction 53198930; blocked by process 30411. Process 30411 waits for ShareLock on transaction 53198931; blocked by process 18092. HINT: See server log for query details. CONTEXT: while updating tuple (15,28) in relation \"payment_methods\" : UPDATE \"payment_methods\" SET \"updated_at\" = '2016-10-20 00:52:19.754301', \"sort_order\" = (\"payment_methods\".\"sort_order\" - 1) WHERE (user_id = 'user_id' AND deleted_at IS NULL) AND (\"payment_methods\".\"sort_order\" > 1) AND (\"payment_methods\".\"sort_order\" <= 3 AND \"payment_methods\".id != 'pm_id')\r\n```\r\n\r\nIs this a known issue? I'm using `acts_as_list (0.7.7)`."},"comment":{"url":"https://api.github.com/repos/swanandp/acts_as_list/issues/comments/254992189","html_url":"https://github.com/swanandp/acts_as_list/issues/235#issuecomment-254992189","issue_url":"https://api.github.com/repos/swanandp/acts_as_list/issues/235","id":254992189,"user":{"login":"brendon","id":81871,"avatar_url":"https://avatars.githubusercontent.com/u/81871?v=3","gravatar_id":"","url":"https://api.github.com/users/brendon","html_url":"https://github.com/brendon","followers_url":"https://api.github.com/users/brendon/followers","following_url":"https://api.github.com/users/brendon/following{/other_user}","gists_url":"https://api.github.com/users/brendon/gists{/gist_id}","starred_url":"https://api.github.com/users/brendon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendon/subscriptions","organizations_url":"https://api.github.com/users/brendon/orgs","repos_url":"https://api.github.com/users/brendon/repos","events_url":"https://api.github.com/users/brendon/events{/privacy}","received_events_url":"https://api.github.com/users/brendon/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T02:22:06Z","updated_at":"2016-10-20T02:22:06Z","body":"Not that we're aware of. Can you try the latest version and see if that helps? Is it to do with with conflicting `ORDER BY` on this query vs another also updating records? I had a similar deadlock problem and it turned out to be due to ordering being overridden resulting in updates occurring from opposite ends of the table and clashing (that's a very technical explanation!).\r\n\r\nWe do lock a record using `with_lock`. I can't remember which version that came out on, so you could try the version before that to see if that is the problem. We're looking at removing of making this lock better."}}
{"actor":{"display_login":"brendon"}}