{"action":"created","comment":{"url":"https://api.github.com/repos/uber/logtron/pulls/comments/30296299","id":30296299,"diff_hunk":"@@ -42,3 +52,65 @@ function writableIsFull(s) {\n \n     return state.length >= state.highWaterMark;\n }\n+\n+/** sentry is a magical special best.\n+\n+We must deep copy the log entry because sentry mutates it.\n+This means if we write to sentry first we will write malformed\n+data to kafka or disk.\n+\n+This is a magical deep copy because it can deep copy error objects\n+\n+*/\n+function magicCopy(entry) {\n+    if (isError(entry)) {\n+        return magicCopyError(entry);\n+    }\n+\n+    var copy = deepExtend({}, entry);\n+\n+    if (typeof entry === 'object' && entry !== null) {\n+        Object.keys(entry).forEach(function copyProp(k) {\n+            var value = entry[k];\n+            if (isError(value)) {","path":"lib/parallel-write.js","position":53,"original_position":53,"commit_id":"87b176068471828e182911c7b584c2d852dccb61","original_commit_id":"87b176068471828e182911c7b584c2d852dccb61","user":{"login":"kriskowal","id":60294,"avatar_url":"https://avatars.githubusercontent.com/u/60294?v=3","gravatar_id":"","url":"https://api.github.com/users/kriskowal","html_url":"https://github.com/kriskowal","followers_url":"https://api.github.com/users/kriskowal/followers","following_url":"https://api.github.com/users/kriskowal/following{/other_user}","gists_url":"https://api.github.com/users/kriskowal/gists{/gist_id}","starred_url":"https://api.github.com/users/kriskowal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kriskowal/subscriptions","organizations_url":"https://api.github.com/users/kriskowal/orgs","repos_url":"https://api.github.com/users/kriskowal/repos","events_url":"https://api.github.com/users/kriskowal/events{/privacy}","received_events_url":"https://api.github.com/users/kriskowal/received_events","type":"User","site_admin":false},"body":"Probably wise to make a stack [] and not recur for hot code. Also, isError in two places in a recursive function can be simplified.","created_at":"2015-05-14T03:50:46Z","updated_at":"2015-05-14T03:50:46Z","html_url":"https://github.com/uber/logtron/pull/24#discussion_r30296299","pull_request_url":"https://api.github.com/repos/uber/logtron/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/uber/logtron/pulls/comments/30296299"},"html":{"href":"https://github.com/uber/logtron/pull/24#discussion_r30296299"},"pull_request":{"href":"https://api.github.com/repos/uber/logtron/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/uber/logtron/pulls/24","id":35386496,"html_url":"https://github.com/uber/logtron/pull/24","diff_url":"https://github.com/uber/logtron/pull/24.diff","patch_url":"https://github.com/uber/logtron/pull/24.patch","issue_url":"https://api.github.com/repos/uber/logtron/issues/24","number":24,"state":"open","locked":false,"title":"Fix sentry by deep copying entry objects","user":{"login":"Raynos","id":479538,"avatar_url":"https://avatars.githubusercontent.com/u/479538?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynos","html_url":"https://github.com/Raynos","followers_url":"https://api.github.com/users/Raynos/followers","following_url":"https://api.github.com/users/Raynos/following{/other_user}","gists_url":"https://api.github.com/users/Raynos/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynos/subscriptions","organizations_url":"https://api.github.com/users/Raynos/orgs","repos_url":"https://api.github.com/users/Raynos/repos","events_url":"https://api.github.com/users/Raynos/events{/privacy}","received_events_url":"https://api.github.com/users/Raynos/received_events","type":"User","site_admin":false},"body":"Sentry backend is weird and mutates the error\nobject which breaks the other backends.\n\nI've added a magic deep copy that works around this\n\nr: @jcorbin @kriskowal","created_at":"2015-05-14T01:19:23Z","updated_at":"2015-05-14T03:50:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a175316a12c2e3dd3c121a385b56a9071da7173","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/logtron/pulls/24/commits","review_comments_url":"https://api.github.com/repos/uber/logtron/pulls/24/comments","review_comment_url":"https://api.github.com/repos/uber/logtron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/logtron/issues/24/comments","statuses_url":"https://api.github.com/repos/uber/logtron/statuses/87b176068471828e182911c7b584c2d852dccb61","head":{"label":"uber:sentry-fix","ref":"sentry-fix","sha":"87b176068471828e182911c7b584c2d852dccb61","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":25270179,"name":"logtron","full_name":"uber/logtron","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/logtron","description":"A logging MACHINE","fork":false,"url":"https://api.github.com/repos/uber/logtron","forks_url":"https://api.github.com/repos/uber/logtron/forks","keys_url":"https://api.github.com/repos/uber/logtron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/logtron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/logtron/teams","hooks_url":"https://api.github.com/repos/uber/logtron/hooks","issue_events_url":"https://api.github.com/repos/uber/logtron/issues/events{/number}","events_url":"https://api.github.com/repos/uber/logtron/events","assignees_url":"https://api.github.com/repos/uber/logtron/assignees{/user}","branches_url":"https://api.github.com/repos/uber/logtron/branches{/branch}","tags_url":"https://api.github.com/repos/uber/logtron/tags","blobs_url":"https://api.github.com/repos/uber/logtron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/logtron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/logtron/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/logtron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/logtron/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/logtron/languages","stargazers_url":"https://api.github.com/repos/uber/logtron/stargazers","contributors_url":"https://api.github.com/repos/uber/logtron/contributors","subscribers_url":"https://api.github.com/repos/uber/logtron/subscribers","subscription_url":"https://api.github.com/repos/uber/logtron/subscription","commits_url":"https://api.github.com/repos/uber/logtron/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/logtron/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/logtron/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/logtron/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/logtron/contents/{+path}","compare_url":"https://api.github.com/repos/uber/logtron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/logtron/merges","archive_url":"https://api.github.com/repos/uber/logtron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/logtron/downloads","issues_url":"https://api.github.com/repos/uber/logtron/issues{/number}","pulls_url":"https://api.github.com/repos/uber/logtron/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/logtron/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/logtron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/logtron/labels{/name}","releases_url":"https://api.github.com/repos/uber/logtron/releases{/id}","created_at":"2014-10-15T19:33:03Z","updated_at":"2015-05-05T18:45:41Z","pushed_at":"2015-05-14T01:19:24Z","git_url":"git://github.com/uber/logtron.git","ssh_url":"git@github.com:uber/logtron.git","clone_url":"https://github.com/uber/logtron.git","svn_url":"https://github.com/uber/logtron","homepage":null,"size":695,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":34,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"29ad69f8f555cf1e28d9a31082b719a2e1cfcec7","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":25270179,"name":"logtron","full_name":"uber/logtron","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/logtron","description":"A logging MACHINE","fork":false,"url":"https://api.github.com/repos/uber/logtron","forks_url":"https://api.github.com/repos/uber/logtron/forks","keys_url":"https://api.github.com/repos/uber/logtron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/logtron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/logtron/teams","hooks_url":"https://api.github.com/repos/uber/logtron/hooks","issue_events_url":"https://api.github.com/repos/uber/logtron/issues/events{/number}","events_url":"https://api.github.com/repos/uber/logtron/events","assignees_url":"https://api.github.com/repos/uber/logtron/assignees{/user}","branches_url":"https://api.github.com/repos/uber/logtron/branches{/branch}","tags_url":"https://api.github.com/repos/uber/logtron/tags","blobs_url":"https://api.github.com/repos/uber/logtron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/logtron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/logtron/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/logtron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/logtron/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/logtron/languages","stargazers_url":"https://api.github.com/repos/uber/logtron/stargazers","contributors_url":"https://api.github.com/repos/uber/logtron/contributors","subscribers_url":"https://api.github.com/repos/uber/logtron/subscribers","subscription_url":"https://api.github.com/repos/uber/logtron/subscription","commits_url":"https://api.github.com/repos/uber/logtron/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/logtron/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/logtron/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/logtron/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/logtron/contents/{+path}","compare_url":"https://api.github.com/repos/uber/logtron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/logtron/merges","archive_url":"https://api.github.com/repos/uber/logtron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/logtron/downloads","issues_url":"https://api.github.com/repos/uber/logtron/issues{/number}","pulls_url":"https://api.github.com/repos/uber/logtron/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/logtron/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/logtron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/logtron/labels{/name}","releases_url":"https://api.github.com/repos/uber/logtron/releases{/id}","created_at":"2014-10-15T19:33:03Z","updated_at":"2015-05-05T18:45:41Z","pushed_at":"2015-05-14T01:19:24Z","git_url":"git://github.com/uber/logtron.git","ssh_url":"git@github.com:uber/logtron.git","clone_url":"https://github.com/uber/logtron.git","svn_url":"https://github.com/uber/logtron","homepage":null,"size":695,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/logtron/pulls/24"},"html":{"href":"https://github.com/uber/logtron/pull/24"},"issue":{"href":"https://api.github.com/repos/uber/logtron/issues/24"},"comments":{"href":"https://api.github.com/repos/uber/logtron/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/logtron/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/logtron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/logtron/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/uber/logtron/statuses/87b176068471828e182911c7b584c2d852dccb61"}}}}