{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/10714","labels_url":"https://api.github.com/repos/apache/spark/issues/10714/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/10714/comments","events_url":"https://api.github.com/repos/apache/spark/issues/10714/events","html_url":"https://github.com/apache/spark/pull/10714","id":126074295,"number":10714,"title":"[SPARK-9844][CORE] File appender race condition during shutdown","user":{"login":"BryanCutler","id":4534389,"avatar_url":"https://avatars.githubusercontent.com/u/4534389?v=3","gravatar_id":"","url":"https://api.github.com/users/BryanCutler","html_url":"https://github.com/BryanCutler","followers_url":"https://api.github.com/users/BryanCutler/followers","following_url":"https://api.github.com/users/BryanCutler/following{/other_user}","gists_url":"https://api.github.com/users/BryanCutler/gists{/gist_id}","starred_url":"https://api.github.com/users/BryanCutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BryanCutler/subscriptions","organizations_url":"https://api.github.com/users/BryanCutler/orgs","repos_url":"https://api.github.com/users/BryanCutler/repos","events_url":"https://api.github.com/users/BryanCutler/events{/privacy}","received_events_url":"https://api.github.com/users/BryanCutler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-12T01:10:54Z","updated_at":"2016-01-12T08:23:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10714","html_url":"https://github.com/apache/spark/pull/10714","diff_url":"https://github.com/apache/spark/pull/10714.diff","patch_url":"https://github.com/apache/spark/pull/10714.patch"},"body":"When an Executor process is destroyed, the FileAppender that is asynchronously reading the stderr stream of the process can throw an IOException during read because the stream is closed.  Before the ExecutorRunner destroys the process, the FileAppender thread is flagged to stop.  This PR wraps the inputStream.read call of the FileAppender in a try/catch block so that if an IOException is thrown and the thread has been flagged to stop, it will safely ignore the exception.  Additionally, the FileAppender thread was changed to use Utils.tryWithSafeFinally to better log any exception that do occur.  Added unit tests to verify a IOException is thrown and logged if FileAppender is not flagged to stop, and that no IOException when the flag is set."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/170835329","html_url":"https://github.com/apache/spark/pull/10714#issuecomment-170835329","issue_url":"https://api.github.com/repos/apache/spark/issues/10714","id":170835329,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T08:23:14Z","updated_at":"2016-01-12T08:23:14Z","body":"Test PASSed.\nRefer to this link for build results (access rights to CI server needed): \nhttps://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/49219/\nTest PASSed."}}