{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/4343","labels_url":"https://api.github.com/repos/apache/spark/issues/4343/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/4343/comments","events_url":"https://api.github.com/repos/apache/spark/issues/4343/events","html_url":"https://github.com/apache/spark/pull/4343","id":56437446,"number":4343,"title":"SPARK-5548: Fixed a race condition in AkkaUtilsSuite","user":{"login":"jacek-lewandowski","id":6516951,"avatar_url":"https://avatars.githubusercontent.com/u/6516951?v=3","gravatar_id":"","url":"https://api.github.com/users/jacek-lewandowski","html_url":"https://github.com/jacek-lewandowski","followers_url":"https://api.github.com/users/jacek-lewandowski/followers","following_url":"https://api.github.com/users/jacek-lewandowski/following{/other_user}","gists_url":"https://api.github.com/users/jacek-lewandowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jacek-lewandowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacek-lewandowski/subscriptions","organizations_url":"https://api.github.com/users/jacek-lewandowski/orgs","repos_url":"https://api.github.com/users/jacek-lewandowski/repos","events_url":"https://api.github.com/users/jacek-lewandowski/events{/privacy}","received_events_url":"https://api.github.com/users/jacek-lewandowski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-03T21:08:40Z","updated_at":"2015-02-04T13:58:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/4343","html_url":"https://github.com/apache/spark/pull/4343","diff_url":"https://github.com/apache/spark/pull/4343.diff","patch_url":"https://github.com/apache/spark/pull/4343.patch"},"body":"`Await.result` and `selection.resolveOne` runs the same timeout simultaneously. When `Await.result` timeout is reached first, then `TimeoutException` is thrown. On the other hand, when `selection.resolveOne` timeout is reached first, `ActorNotFoundException` is thrown. This is an obvious race condition and the easiest way to fix it is to increase the timeout of one method to make sure the code fails on the other method first. \r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/72858032","html_url":"https://github.com/apache/spark/pull/4343#issuecomment-72858032","issue_url":"https://api.github.com/repos/apache/spark/issues/4343","id":72858032,"user":{"login":"jacek-lewandowski","id":6516951,"avatar_url":"https://avatars.githubusercontent.com/u/6516951?v=3","gravatar_id":"","url":"https://api.github.com/users/jacek-lewandowski","html_url":"https://github.com/jacek-lewandowski","followers_url":"https://api.github.com/users/jacek-lewandowski/followers","following_url":"https://api.github.com/users/jacek-lewandowski/following{/other_user}","gists_url":"https://api.github.com/users/jacek-lewandowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jacek-lewandowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacek-lewandowski/subscriptions","organizations_url":"https://api.github.com/users/jacek-lewandowski/orgs","repos_url":"https://api.github.com/users/jacek-lewandowski/repos","events_url":"https://api.github.com/users/jacek-lewandowski/events{/privacy}","received_events_url":"https://api.github.com/users/jacek-lewandowski/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T13:58:38Z","updated_at":"2015-02-04T13:58:38Z","body":"@pwendell I think the problem with catching either exception is that the `ActorNotFoundException` is also thrown in other situations - in this particular test we want to prove that actor system A cannot connect to the other actor system B because A doesn't trust B, and this results in timeout. This is even lower communication layer than SASL. \r\nOn the other hand `ActorNotFoundException` is thrown in case of timeout, in case there is no actor with that name or in case of authentication problems - completely different situations because they occur when we are successfully connected to the other actor system and that remote actor system refuses to return the reference to the requested actor. \r\nTherefore, `ActorNotFoundException` when not related to the timeout should cause the test to fail because it means that we successfully connected to untrusted actor system.\r\n"}}