-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heroku timesout when connecting to RedisToGo with Aleph #53
Comments
(def r (delay (redis-client ...)))
(@r [:get :foo]) should only connect when you make your first request. I think there's definitely value in having a :lazy-connect? option, though. Expect to see it in a future release. |
Thanks Zach, Tested out delaying the connection: dmix/documeds@2aca28b But its still timing out on deploy. I've contacted Heroku, but its been almost 20hrs with no reply. So I imagine they dont have an easy answer either. This may be more of a heroku problem than a Aleph, so I'll likely close this issue shortly unless I can think of some other ideas. |
How is the timeout manifesting itself? I don't see a timeout on the Redis calls, this is just when it's connecting? |
Could it be an issue with the options you pass to the client ? From the names it seems you are using an URL instead of a hostname as a value for :host |
Yeah I'd like to provide more details on where its timing out, but heroku/clojure isnt outputting anything. Here are the heroku logs https://gist.github.com/1842439 When I connect locally or to the remote repl ("heroku run lein run repl") and paste in the same aleph code, it works. So I imagine the credentials are fine. The url variable is indeed the RedisToGo host and not the full URL. |
Okay, I see from your issue on the Heroku mailing list that it's never starting up the server. If you just (def r nil) does that boot up okay? If you've delayed the creation of the redis client, there's no way it should be interfering with the server starting up. |
Yep, if I define (def r ()) it deploys fine. |
Can you log when the redis-client is realized? Something like (def r
(delay
(println "REALIZING...")
(redis-client {:host redis-url :password redis-pass :port redis-port}))) You might even try (.printStackTrace (Exception.)) within the delay scope to tell you what's triggering it. The only way the empty value and delay block can differ in the behavior is if something's realizing the client before the server binds to the port. |
Went for a coffee and came back,now its running fine in production. Tried redeploying and it worked again. It's possible that a) delaying the process fixed the issue and it didn't deploy properly earlier or b) a heroku staffer fixed the issue and hasnt notified me yet. Either way its fixed and I appreciate the help. |
I'm trying to deploy a clojure Noir app to heroku, but the deployment fails because the app timesout and never properly starts
When I remove the Aleph redis code, it deploys fine. Also, oddly, when I connect to the heroku server and use a REPL, paste in the same aleph connection code, I can access redis no problem.
So since the problem is at bootup, is there a way to load the redis connection differently or at a later time? For example, on the first request: connect to redis if it hasn't yet?
The code for my app is here: https://github.com/dmix/documeds
The text was updated successfully, but these errors were encountered: