{"action":"created","issue":{"url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/108","labels_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/108/comments","events_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/108/events","html_url":"https://github.com/SocketCluster/socketcluster/issues/108","id":104989395,"number":108,"title":"Fix the shutdown order of SC processes to avoid throwing errors during shutdown via SIGTERM","user":{"login":"jondubois","id":1187447,"avatar_url":"https://avatars.githubusercontent.com/u/1187447?v=3","gravatar_id":"","url":"https://api.github.com/users/jondubois","html_url":"https://github.com/jondubois","followers_url":"https://api.github.com/users/jondubois/followers","following_url":"https://api.github.com/users/jondubois/following{/other_user}","gists_url":"https://api.github.com/users/jondubois/gists{/gist_id}","starred_url":"https://api.github.com/users/jondubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jondubois/subscriptions","organizations_url":"https://api.github.com/users/jondubois/orgs","repos_url":"https://api.github.com/users/jondubois/repos","events_url":"https://api.github.com/users/jondubois/events{/privacy}","received_events_url":"https://api.github.com/users/jondubois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-05T00:03:44Z","updated_at":"2015-10-26T04:01:36Z","closed_at":null,"body":"In particular, this error:\r\n\r\n```bash\r\n1441383500084 - Origin: IOCluster\r\n    [Error] Error: nData server at socket path /var/folders/kz/l3s2fpd51ln9_p9ymvqbyshm0000gr/b0 exited\r\n    at EventEmitter.<anonymous> (/Users/node_modules/socketcluster/node_modules/iocluster/index.js:333:28)\r\n    at EventEmitter.emit (events.js:110:17)\r\n    at ChildProcess.<anonymous> (/Users/node_modules/socketcluster/node_modules/iocluster/node_modules/ndata/index.js:51:10)\r\n    at ChildProcess.emit (events.js:110:17)\r\n    at Process.ChildProcess._handle.onexit (child_process.js:1074:12)\r\n```\r\n\r\nThis snippet from @IngwiePhoenix apparently fixes the issue:\r\n\r\n```js\r\nhouse.addShutdownHandler(function(ctx, next){\r\n    socketCluster.killWorkers();\r\n    socketCluster.killBrokers();\r\n    next();\r\n});\r\n```\r\n\r\nRight now processes are not being shut down in the optimal order and this causes unnecessary errors when using SIGTERM."},"comment":{"url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/comments/151018925","html_url":"https://github.com/SocketCluster/socketcluster/issues/108#issuecomment-151018925","issue_url":"https://api.github.com/repos/SocketCluster/socketcluster/issues/108","id":151018925,"user":{"login":"roblav96","id":1457327,"avatar_url":"https://avatars.githubusercontent.com/u/1457327?v=3","gravatar_id":"","url":"https://api.github.com/users/roblav96","html_url":"https://github.com/roblav96","followers_url":"https://api.github.com/users/roblav96/followers","following_url":"https://api.github.com/users/roblav96/following{/other_user}","gists_url":"https://api.github.com/users/roblav96/gists{/gist_id}","starred_url":"https://api.github.com/users/roblav96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roblav96/subscriptions","organizations_url":"https://api.github.com/users/roblav96/orgs","repos_url":"https://api.github.com/users/roblav96/repos","events_url":"https://api.github.com/users/roblav96/events{/privacy}","received_events_url":"https://api.github.com/users/roblav96/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T04:01:36Z","updated_at":"2015-10-26T04:01:36Z","body":"what is this house variable!? lol"}}