bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.97k stars 402 forks source link

Release command takes forever #519

Closed imranismail closed 6 years ago

imranismail commented 6 years ago

Steps to reproduce

mix release under dev or prod

I was at 2.0.5 and after updating to 2.0.9 this happens.

Verbose Logs

Description of issue

bitwalker commented 6 years ago

I'm not able to reproduce this - can you provide any additional information or a reproducible case? Are you able to reproduce with my test project?

danschultzer commented 6 years ago

After upgrading from 2.0.0-rc.4 to 2.0.9 I've experienced that building releases takes very long time too (went from around 20-ish seconds to 500+ seconds, that caused timeouts in our CI). It's a big complex project so it'll be difficult to replicate. Instead I'll try dig through what change in distillery that caused the increase in build time.

I did some testing, and it seems that reverting to 2.0.5 fixes the issue, there's some other issues going on with 2.0.7-2.0.8 (seeing some Invalid start type given for errors).

danschultzer commented 6 years ago

So I think it may have to do with this recursion loop in the release module: https://github.com/bitwalker/distillery/blob/master/lib/mix/lib/releases/models/release.ex#L506-L509

It constantly repeats going through kernel and stdlib. This might be working as intended, however, it doesn't seem like the previous code has any such recursion: https://github.com/bitwalker/distillery/blob/2.0.5/lib/mix/lib/releases/models/release.ex#L415

I'm not sure this is actually the issue, but there's definitely a significant run time increase with that particular code change. I'll dig more into it tomorrow when I got some time available.