{"action":"created","issue":{"url":"https://api.github.com/repos/linkedin/gobblin/issues/494","labels_url":"https://api.github.com/repos/linkedin/gobblin/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/494/comments","events_url":"https://api.github.com/repos/linkedin/gobblin/issues/494/events","html_url":"https://github.com/linkedin/gobblin/pull/494","id":119836633,"number":494,"title":"Resolve race condition between writer and metric updater","user":{"login":"zliu41","id":6342538,"avatar_url":"https://avatars.githubusercontent.com/u/6342538?v=3","gravatar_id":"","url":"https://api.github.com/users/zliu41","html_url":"https://github.com/zliu41","followers_url":"https://api.github.com/users/zliu41/followers","following_url":"https://api.github.com/users/zliu41/following{/other_user}","gists_url":"https://api.github.com/users/zliu41/gists{/gist_id}","starred_url":"https://api.github.com/users/zliu41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zliu41/subscriptions","organizations_url":"https://api.github.com/users/zliu41/orgs","repos_url":"https://api.github.com/users/zliu41/repos","events_url":"https://api.github.com/users/zliu41/events{/privacy}","received_events_url":"https://api.github.com/users/zliu41/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-01T23:58:43Z","updated_at":"2015-12-01T23:58:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/494","html_url":"https://github.com/linkedin/gobblin/pull/494","diff_url":"https://github.com/linkedin/gobblin/pull/494.diff","patch_url":"https://github.com/linkedin/gobblin/pull/494.patch"},"body":"There is a race condition between `Fork.updateByteMetrics()` and `AvroHdfsDataWriter.bytesWritten()`. Between `if (!this.fs.exists(this.outputFile))` and `return this.fs.getFileStatus(this.outputFile).getLen()`, the output file could be renamed (adding row count to file name). Adding synchronization to resolve this. \r\n\r\nAlso, reset `this.outputFile` to new path after renaming."},"comment":{"url":"https://api.github.com/repos/linkedin/gobblin/issues/comments/161136187","html_url":"https://github.com/linkedin/gobblin/pull/494#issuecomment-161136187","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/494","id":161136187,"user":{"login":"zliu41","id":6342538,"avatar_url":"https://avatars.githubusercontent.com/u/6342538?v=3","gravatar_id":"","url":"https://api.github.com/users/zliu41","html_url":"https://github.com/zliu41","followers_url":"https://api.github.com/users/zliu41/followers","following_url":"https://api.github.com/users/zliu41/following{/other_user}","gists_url":"https://api.github.com/users/zliu41/gists{/gist_id}","starred_url":"https://api.github.com/users/zliu41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zliu41/subscriptions","organizations_url":"https://api.github.com/users/zliu41/orgs","repos_url":"https://api.github.com/users/zliu41/repos","events_url":"https://api.github.com/users/zliu41/events{/privacy}","received_events_url":"https://api.github.com/users/zliu41/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T23:58:53Z","updated_at":"2015-12-01T23:58:53Z","body":"@liyinan926 can you review?"}}