{"action":"created","issue":{"url":"https://api.github.com/repos/akira/exq/issues/186","repository_url":"https://api.github.com/repos/akira/exq","labels_url":"https://api.github.com/repos/akira/exq/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/akira/exq/issues/186/comments","events_url":"https://api.github.com/repos/akira/exq/issues/186/events","html_url":"https://github.com/akira/exq/issues/186","id":151688290,"number":186,"title":"Exq shuts down when losing redis connection","user":{"login":"rranelli","id":4231743,"avatar_url":"https://avatars.githubusercontent.com/u/4231743?v=3","gravatar_id":"","url":"https://api.github.com/users/rranelli","html_url":"https://github.com/rranelli","followers_url":"https://api.github.com/users/rranelli/followers","following_url":"https://api.github.com/users/rranelli/following{/other_user}","gists_url":"https://api.github.com/users/rranelli/gists{/gist_id}","starred_url":"https://api.github.com/users/rranelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rranelli/subscriptions","organizations_url":"https://api.github.com/users/rranelli/orgs","repos_url":"https://api.github.com/users/rranelli/repos","events_url":"https://api.github.com/users/rranelli/events{/privacy}","received_events_url":"https://api.github.com/users/rranelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-28T16:34:54Z","updated_at":"2016-05-03T04:57:56Z","closed_at":null,"body":"I'm very interested in using `Exq` in production but I found the two following\r\nissues:\r\n\r\n  - The application won't start if Redis is down. I understand the reasons not\r\n    to allow `Exq` to start if Redis is unavailable, but since `Exq` won't\r\n    play a *vital* part of my system, I would rather have `Exq` up and handle\r\n    all `enqueue` errors myself. I think this behavior should be `opt-in`.\r\n    What do you guys think??\r\n\r\n  - **After** the application has started, if it loses connection with Redis\r\n    the application will shut down too. If I understood correctly the\r\n    discussion @ #136, this wasn't supposed to happen. If Redis gets back\r\n    online, `Exq` is not restarted:\r\n\r\n```\r\n13:32:26.903 [error] GenServer Exq.Redis.Client terminating\r\n** (stop) :econnrefused\r\nLast message: nil\r\nState: %{opts: [socket_opts: [], backoff: nil, host: \"127.0.0.1\", port: 6379, database: nil, password: nil], receiver: nil, reconnection_attempts: 0, socket: nil, tail: \"\"}\r\n13:32:26.903 [error] GenServer Exq.Scheduler terminating\r\n** (stop) exited in: :gen_server.call(Exq.Redis.Client, {:commands, [[\"ZRANGEBYSCORE\", \"exq:schedule\", 0, \"1461861146.880515\"], [\"ZRANGEBYSCORE\", \"exq:retry\", 0, \"1461861146\r\n.880515\"]]}, 5000)\r\n    ** (EXIT) :econnrefused\r\n    (stdlib) gen_server.erl:212: :gen_server.call/3\r\n    (exq) lib/exq/redis/job_queue.ex:136: Exq.Redis.JobQueue.scheduler_dequeue/3\r\n    (exq) lib/exq/scheduler/server.ex:68: Exq.Scheduler.Server.dequeue/1\r\n    (exq) lib/exq/scheduler/server.ex:56: Exq.Scheduler.Server.handle_info/2\r\n    (stdlib) gen_server.erl:615: :gen_server.try_dispatch/4\r\n    (stdlib) gen_server.erl:681: :gen_server.handle_msg/5\r\n    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3\r\nLast message: {:\"$gen_cast\", :start_timeout}\r\nState: %Exq.Scheduler.Server.State{namespace: \"exq\", queues: [\"default\"], redis: Exq.Redis.Client, scheduler_poll_timeout: 200}\r\n13:32:26.903 [info] Application exq exited: shutdown\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/akira/exq/issues/comments/216435250","html_url":"https://github.com/akira/exq/issues/186#issuecomment-216435250","issue_url":"https://api.github.com/repos/akira/exq/issues/186","id":216435250,"user":{"login":"akira","id":43946,"avatar_url":"https://avatars.githubusercontent.com/u/43946?v=3","gravatar_id":"","url":"https://api.github.com/users/akira","html_url":"https://github.com/akira","followers_url":"https://api.github.com/users/akira/followers","following_url":"https://api.github.com/users/akira/following{/other_user}","gists_url":"https://api.github.com/users/akira/gists{/gist_id}","starred_url":"https://api.github.com/users/akira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akira/subscriptions","organizations_url":"https://api.github.com/users/akira/orgs","repos_url":"https://api.github.com/users/akira/repos","events_url":"https://api.github.com/users/akira/events{/privacy}","received_events_url":"https://api.github.com/users/akira/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T04:57:56Z","updated_at":"2016-05-03T04:57:56Z","body":"Yeah, that's what I mean, but you kill \"Elixir.AsyncQueue\" then it would get restarted in this case?  You can try to do that through the observer UI. The idea is that the process should be supervised, so if you kill it, it should restart the process automatically.  "}}