aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
Gleb Posobin 2020-05-17T21:51:47.201400Z

I am using cognitect's aws api, and creating an api client with (aws/client {:api :s3 ...}), for some reason it gets stuck when called from a namespace on repl init (i.e. I add (def x (aws/client ...)) call to the namespace which is marked as init-ns in my project.clj, run lein repl and it hangs), but works if I comment it out in the namespace and run (def x (aws/client ...)) inside the repl after the repl has started up. In the repl it works quickly, certainly in under a second, I've tried larger repl timeout than the default 30s, it doesn't help. Any ideas what could be the cause of this?

ghadi 2020-05-17T22:12:32.203400Z

clients are not designed to be def'fed top-level. wrap it in a delay if you really need it top-level

Gleb Posobin 2020-05-17T22:18:10.206300Z

Ok, thanks! Out of curiosity, what's the difference between when it is top-level vs when it is not? What breaks? I assumed that writing lines in the repl is the same as basically appending the lines to the namespace repl is in.

ghadi 2020-05-17T22:18:12.206400Z

that being said, it's unclear what you're specifically running into

ghadi 2020-05-17T22:18:42.207100Z

(there are some side-effects of client construction that may be undesired)

ghadi 2020-05-17T22:19:33.207900Z

in the REPL for exploration I think it's fine, yes it's similar to top-level in a namespace

ghadi 2020-05-17T22:20:08.208700Z

you can run jstack on the jvm to tell you what is hung

ghadi 2020-05-17T22:21:10.209600Z

we have some upcoming changes that may make it easier to def a client top-level @posobin, but it's not an explicit goal of those changes

👍 1
ghadi 2020-05-17T22:22:07.210100Z

i'm curious what it's hung on...

Gleb Posobin 2020-05-17T22:26:20.210600Z