Capistrano hangs on assets precompile and never finishes the deploy

This only started happening after I killed a deploy that was half completed. It could have been during the asset precompile process, I don’t remember. It’s weird though because the symptoms seem more like an ssh session issue and less like residual files from my cancelled deploy that is causing the issue.

I added keep alive options to ssh:

:ssh_options => {
  :keepalive => true,
  :keepalive_interval => 30
}

I also confirmed that tmp/cache was in my linked dirs to save some precompile time. It was suggested in the repo issues thread.

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets public/system}