{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/9138","labels_url":"https://api.github.com/repos/apache/spark/issues/9138/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/9138/comments","events_url":"https://api.github.com/repos/apache/spark/issues/9138/events","html_url":"https://github.com/apache/spark/pull/9138","id":111679829,"number":9138,"title":"[SPARK-11131] [core] Fix race in worker registration protocol.","user":{"login":"vanzin","id":1694083,"avatar_url":"https://avatars.githubusercontent.com/u/1694083?v=3","gravatar_id":"","url":"https://api.github.com/users/vanzin","html_url":"https://github.com/vanzin","followers_url":"https://api.github.com/users/vanzin/followers","following_url":"https://api.github.com/users/vanzin/following{/other_user}","gists_url":"https://api.github.com/users/vanzin/gists{/gist_id}","starred_url":"https://api.github.com/users/vanzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanzin/subscriptions","organizations_url":"https://api.github.com/users/vanzin/orgs","repos_url":"https://api.github.com/users/vanzin/repos","events_url":"https://api.github.com/users/vanzin/events{/privacy}","received_events_url":"https://api.github.com/users/vanzin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-15T18:35:19Z","updated_at":"2015-10-17T01:38:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/9138","html_url":"https://github.com/apache/spark/pull/9138","diff_url":"https://github.com/apache/spark/pull/9138.diff","patch_url":"https://github.com/apache/spark/pull/9138.patch"},"body":"Because the registration RPC was not really an RPC, but a bunch of\r\ndisconnected messages, it was possible for other messages to be\r\nsent before the reply to the registration arrived, and that would\r\nconfuse the Worker. Especially in local-cluster mode, the worker was\r\nsucceptible to receiving an executor request before it received a\r\nmessage from the master saying registration succeeded.\r\n\r\nOn top of the above, the change also fixes a ClassCastException when\r\nthe registration fails, which also affects the executor registration\r\nprotocol. Because the `ask` is issued with a specific return type,\r\nif the error message (of a different type) was returned instead, the\r\ncode would just die with an exception. This is fixed by having a common\r\nbase trait for these reply messages."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/148875112","html_url":"https://github.com/apache/spark/pull/9138#issuecomment-148875112","issue_url":"https://api.github.com/repos/apache/spark/issues/9138","id":148875112,"user":{"login":"vanzin","id":1694083,"avatar_url":"https://avatars.githubusercontent.com/u/1694083?v=3","gravatar_id":"","url":"https://api.github.com/users/vanzin","html_url":"https://github.com/vanzin","followers_url":"https://api.github.com/users/vanzin/followers","following_url":"https://api.github.com/users/vanzin/following{/other_user}","gists_url":"https://api.github.com/users/vanzin/gists{/gist_id}","starred_url":"https://api.github.com/users/vanzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanzin/subscriptions","organizations_url":"https://api.github.com/users/vanzin/orgs","repos_url":"https://api.github.com/users/vanzin/repos","events_url":"https://api.github.com/users/vanzin/events{/privacy}","received_events_url":"https://api.github.com/users/vanzin/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T01:38:41Z","updated_at":"2015-10-17T01:38:41Z","body":"@andrewor14 correct, that's what causes the race."}}