{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4129","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4129/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4129/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4129/events","html_url":"https://github.com/facebook/hhvm/issues/4129","id":47690388,"number":4129,"title":"Takeover functionality is broken","user":{"login":"lavagetto","id":1475424,"avatar_url":"https://avatars.githubusercontent.com/u/1475424?v=3","gravatar_id":"","url":"https://api.github.com/users/lavagetto","html_url":"https://github.com/lavagetto","followers_url":"https://api.github.com/users/lavagetto/followers","following_url":"https://api.github.com/users/lavagetto/following{/other_user}","gists_url":"https://api.github.com/users/lavagetto/gists{/gist_id}","starred_url":"https://api.github.com/users/lavagetto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavagetto/subscriptions","organizations_url":"https://api.github.com/users/lavagetto/orgs","repos_url":"https://api.github.com/users/lavagetto/repos","events_url":"https://api.github.com/users/lavagetto/events{/privacy}","received_events_url":"https://api.github.com/users/lavagetto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/feature%20request","name":"feature request","color":"ededed"},{"url":"https://api.github.com/repos/facebook/hhvm/labels/webserver","name":"webserver","color":"22CCAA"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-11-04T08:52:25Z","updated_at":"2015-07-20T16:33:57Z","closed_at":null,"body":"I was experimenting with the idea of having HHVM restarts being graceful without needing to drain traffic from the upstream HTTP proxy, and found the TakeOverFilename option, which seemed promising.\r\n\r\nWhen I noticed it doesn't work, I also saw it didn't just because the new server tries to stop the old one by calling `/stop` on the admin server port, via http - as can be seen in `hphp/runtime/server/http-server.cpp` at line 549. Unluckily, the admin server now speaks fastcgi, not http, so what you get in the stdout of the \"old\" server is:\r\n\r\n```\r\n$ hhvm -m server -vServer.Type=fastcgi -vServer.Port=9000 -vServer.TakeoverFilename=/tmp/hhvm-takeover -vAdminServer.Port=9001\r\nmapping self...\r\nmapping self took 0'00\" (2198 us) wall time\r\nloading static content...\r\nloading static content took 0'00\" (0 us) wall time\r\npage server started\r\nadmin server started\r\nall servers started\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\nFastCGI protocol: received an invalid record\r\n```\r\n\r\nand so on ad-libitum. The correct fix for this would be to make the takeover mechanism use the fastcgi protocol, while an hotfix would be letting people specify an AdminServer.HttpPort runtime option."},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/122941949","html_url":"https://github.com/facebook/hhvm/issues/4129#issuecomment-122941949","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4129","id":122941949,"user":{"login":"jazzdan","id":452453,"avatar_url":"https://avatars.githubusercontent.com/u/452453?v=3","gravatar_id":"","url":"https://api.github.com/users/jazzdan","html_url":"https://github.com/jazzdan","followers_url":"https://api.github.com/users/jazzdan/followers","following_url":"https://api.github.com/users/jazzdan/following{/other_user}","gists_url":"https://api.github.com/users/jazzdan/gists{/gist_id}","starred_url":"https://api.github.com/users/jazzdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazzdan/subscriptions","organizations_url":"https://api.github.com/users/jazzdan/orgs","repos_url":"https://api.github.com/users/jazzdan/repos","events_url":"https://api.github.com/users/jazzdan/events{/privacy}","received_events_url":"https://api.github.com/users/jazzdan/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T16:33:57Z","updated_at":"2015-07-20T16:33:57Z","body":"Take over would also be useful for us doing continuous deployment with repo auth mode in the future. 60+/deploys per day when you have to drain and restart the whole fleet isn't very feasible."}}