opscode/chef — comment on commit 2ab331a14745811370a8404edb665652f1267710
File: chef/lib/chef/provider/deploy.rb line 224
By zimbatm:

This operation is not atomic, if the web server links to release_path, the static files will be unavailable for that time.

Moreover, if the operation fails, the old link is not restored (or maybe in a later rollback phase).

In POSIX systems, move is atomic,

1) ln -s $current_path /tmp/future_release
2) mv -T /tmp/future_release $release_path

If 1) fails, release_path still links on the old release
If 2) fails, release_path still links on the old release

The -T option ensures that the symlink is not moved inside the old release