From cbbca8319beaa5afde5cd74a92f0b74529a1b51e Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 13 Jun 2013 16:22:22 -0400 Subject: [PATCH] Restart Tornado _after_ moving the deployment symlink. Otherwise we end up running Tornado against the _previous_ version of our code! Testing of using supervisorctl to stop and then start a process shows it takes about the same amount of time as doing a supervisorctl restart, so there's no reason not to split the two commands apart and make it super clear that nothing is running at the time that we move the deployment symlink. (imported from commit c38049da2bfc9fa94320a32dbf3240d1fcba67f7) --- tools/restart-server | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/restart-server b/tools/restart-server index 6c869480c6..c8bd0c89fe 100755 --- a/tools/restart-server +++ b/tools/restart-server @@ -26,10 +26,11 @@ subprocess.check_call(["python", "./manage.py", "fill_memcached_caches"]) logging.info("Killing daemons") subprocess.check_call(["supervisorctl", "stop", "humbug-workers:*"]) subprocess.check_call(["supervisorctl", "stop", "humbug-django"]) -subprocess.check_call(["supervisorctl", "restart", "humbug-tornado"]) +subprocess.check_call(["supervisorctl", "stop", "humbug-tornado"]) subprocess.check_call(["ln", '-nsf', deploy_path, os.path.join(DEPLOYMENTS_DIR, "current")]) +subprocess.check_call(["supervisorctl", "start", "humbug-tornado"]) subprocess.check_call(["supervisorctl", "start", "humbug-django"]) subprocess.check_call(["supervisorctl", "start", "humbug-workers:*"])