{"action":"created","issue":{"url":"https://api.github.com/repos/chanks/que/issues/93","labels_url":"https://api.github.com/repos/chanks/que/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/chanks/que/issues/93/comments","events_url":"https://api.github.com/repos/chanks/que/issues/93/events","html_url":"https://github.com/chanks/que/issues/93","id":59323386,"number":93,"title":"Que doesn't reconnect after PG::UnableToSend","user":{"login":"chendo","id":2661,"avatar_url":"https://avatars.githubusercontent.com/u/2661?v=3","gravatar_id":"","url":"https://api.github.com/users/chendo","html_url":"https://github.com/chendo","followers_url":"https://api.github.com/users/chendo/followers","following_url":"https://api.github.com/users/chendo/following{/other_user}","gists_url":"https://api.github.com/users/chendo/gists{/gist_id}","starred_url":"https://api.github.com/users/chendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chendo/subscriptions","organizations_url":"https://api.github.com/users/chendo/orgs","repos_url":"https://api.github.com/users/chendo/repos","events_url":"https://api.github.com/users/chendo/events{/privacy}","received_events_url":"https://api.github.com/users/chendo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-28T03:41:27Z","updated_at":"2015-03-02T04:53:16Z","closed_at":null,"body":"que 0.9.1.\r\n\r\nWe've seen some cases where Que loses the connection to Postgres and we see log messages saying:\r\n\r\n```\r\n{\"lib\":\"que\",\"hostname\":\"<snip>\",\"pid\":37,\"thread\":69940584448760,\"event\":\"job_errored\",\"error\":{\"class\":\"PG::UnableToSend\",\"message\":\"\"},\"job\":null}\r\n```\r\n\r\nA restart of the app is required to resolve this issue. Also, the `Que.error_handler` doesn't get called for this error, so the only way we noticed it was alerts from jobs not being run. We haven't tried 0.9.2 just yet as I only noticed the update when I came to file an issue, but 0.9.2 doesn't look like it has a fix for it."},"comment":{"url":"https://api.github.com/repos/chanks/que/issues/comments/76658484","html_url":"https://github.com/chanks/que/issues/93#issuecomment-76658484","issue_url":"https://api.github.com/repos/chanks/que/issues/93","id":76658484,"user":{"login":"chanks","id":300058,"avatar_url":"https://avatars.githubusercontent.com/u/300058?v=3","gravatar_id":"","url":"https://api.github.com/users/chanks","html_url":"https://github.com/chanks","followers_url":"https://api.github.com/users/chanks/followers","following_url":"https://api.github.com/users/chanks/following{/other_user}","gists_url":"https://api.github.com/users/chanks/gists{/gist_id}","starred_url":"https://api.github.com/users/chanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanks/subscriptions","organizations_url":"https://api.github.com/users/chanks/orgs","repos_url":"https://api.github.com/users/chanks/repos","events_url":"https://api.github.com/users/chanks/events{/privacy}","received_events_url":"https://api.github.com/users/chanks/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T04:53:16Z","updated_at":"2015-03-02T04:53:16Z","body":"Explicitly setting the adapter wouldn't help. Does it appear that Que keeps\nraising PG::UnableToSend even after ActiveRecord is able to start executing\nqueries again (assuming you're running them in the same process and they're\nsharing a connection pool)? If so, I don't have an immediate explanation\nfor that.\n\nNot familiar with pgpool or haproxy, but if they work like pg_bouncer,\nyou'll probably get issues of some kind (though not PG::UnableToSend, I'd\nthink) - Que relies on being able to use the same connection as it takes a\nlock, completes a job, and then releases the lock (and not all in the\ncontext of a transaction, either).\n\nOn Sun, Mar 1, 2015 at 11:42 PM, Jack Chen <notifications@github.com> wrote:\n\n> Hmm, yeah I can't see how it wouldn't be either. Will try wrapping the\n> error handler and checking.\n>\n> We're using the pg gem in Rails 4.2.0. Rails itself seems to handle\n> reconnections fine, but Que doesn't appear to recover for some reason. We\n> haven't explicitly set the adapter yet (should we?).\n>\n> For the record, we're using pgpool load balanced behind haproxy.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/chanks/que/issues/93#issuecomment-76657898>.\n>\n"}}