{"action":"created","comment":{"url":"https://api.github.com/repos/bitly/nsq/pulls/comments/34416466","id":34416466,"diff_hunk":"@@ -261,6 +261,14 @@ func (d *diskQueue) readOne() ([]byte, error) {\n \t\treturn nil, err\n \t}\n \n+\tif msgSize < minMsgSize {","path":"nsqd/diskqueue.go","position":4,"original_position":4,"commit_id":"1ce7fa22c0c8e43df5ba5a9ecd8a9ddd4c2cb465","original_commit_id":"1ce7fa22c0c8e43df5ba5a9ecd8a9ddd4c2cb465","user":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"body":"If the receiver reads an invalid message, there is no way for the receiver\nto invalidate the current backing file. This also means that any new read\nfrom the current file cannot be trusted, as if the reader trusts the file\nto only contain messages, and it doesn't, how can the reader know any more\nof the current file is valid?\n\nOn Saturday, July 11, 2015, Matt Reiferson <notifications@github.com> wrote:\n\n> In nsqd/diskqueue.go\n> <https://github.com/bitly/nsq/pull/600#discussion_r34415836>:\n>\n> > @@ -261,6 +261,14 @@ func (d *diskQueue) readOne() ([]byte, error) {\n> >  \t\treturn nil, err\n> >  \t}\n> >\n> > +\tif msgSize < minMsgSize {\n>\n> DiskQueue doesn't (and arguably shouldn't) know about \"messages\". I think\n> that DiskQueue should test for msgSize > 0, not minMsgSize. The receiver\n> of the read channel should enforce that the size is appropriate for a\n> message, i.e. at least minMsgSize, so we can create an additional check\n> there.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/bitly/nsq/pull/600/files#r34415836>.\n>\n","created_at":"2015-07-11T21:28:21Z","updated_at":"2015-07-11T21:28:21Z","html_url":"https://github.com/bitly/nsq/pull/600#discussion_r34416466","pull_request_url":"https://api.github.com/repos/bitly/nsq/pulls/600","_links":{"self":{"href":"https://api.github.com/repos/bitly/nsq/pulls/comments/34416466"},"html":{"href":"https://github.com/bitly/nsq/pull/600#discussion_r34416466"},"pull_request":{"href":"https://api.github.com/repos/bitly/nsq/pulls/600"}}},"pull_request":{"url":"https://api.github.com/repos/bitly/nsq/pulls/600","id":39644204,"html_url":"https://github.com/bitly/nsq/pull/600","diff_url":"https://github.com/bitly/nsq/pull/600.diff","patch_url":"https://github.com/bitly/nsq/pull/600.patch","issue_url":"https://api.github.com/repos/bitly/nsq/issues/600","number":600,"state":"open","locked":false,"title":"nsqd: enforce minimum msg size when reading from the diskqueue","user":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"body":"See bitly/nsq#598\r\n\r\nThis does not yet enforce a maximum message size. This can be added with a diskqueue API change to take either a `*context` or a `maxBytesPerMessage` argument.","created_at":"2015-07-10T01:13:35Z","updated_at":"2015-07-11T21:28:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da65bc6d576ab5374391cee08080e77d96062d4d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitly/nsq/pulls/600/commits","review_comments_url":"https://api.github.com/repos/bitly/nsq/pulls/600/comments","review_comment_url":"https://api.github.com/repos/bitly/nsq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitly/nsq/issues/600/comments","statuses_url":"https://api.github.com/repos/bitly/nsq/statuses/1ce7fa22c0c8e43df5ba5a9ecd8a9ddd4c2cb465","head":{"label":"twmb:598_enforce_msg_size","ref":"598_enforce_msg_size","sha":"1ce7fa22c0c8e43df5ba5a9ecd8a9ddd4c2cb465","user":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"repo":{"id":25232198,"name":"nsq","full_name":"twmb/nsq","owner":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twmb/nsq","description":"A realtime distributed messaging platform","fork":true,"url":"https://api.github.com/repos/twmb/nsq","forks_url":"https://api.github.com/repos/twmb/nsq/forks","keys_url":"https://api.github.com/repos/twmb/nsq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twmb/nsq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twmb/nsq/teams","hooks_url":"https://api.github.com/repos/twmb/nsq/hooks","issue_events_url":"https://api.github.com/repos/twmb/nsq/issues/events{/number}","events_url":"https://api.github.com/repos/twmb/nsq/events","assignees_url":"https://api.github.com/repos/twmb/nsq/assignees{/user}","branches_url":"https://api.github.com/repos/twmb/nsq/branches{/branch}","tags_url":"https://api.github.com/repos/twmb/nsq/tags","blobs_url":"https://api.github.com/repos/twmb/nsq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twmb/nsq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twmb/nsq/git/refs{/sha}","trees_url":"https://api.github.com/repos/twmb/nsq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twmb/nsq/statuses/{sha}","languages_url":"https://api.github.com/repos/twmb/nsq/languages","stargazers_url":"https://api.github.com/repos/twmb/nsq/stargazers","contributors_url":"https://api.github.com/repos/twmb/nsq/contributors","subscribers_url":"https://api.github.com/repos/twmb/nsq/subscribers","subscription_url":"https://api.github.com/repos/twmb/nsq/subscription","commits_url":"https://api.github.com/repos/twmb/nsq/commits{/sha}","git_commits_url":"https://api.github.com/repos/twmb/nsq/git/commits{/sha}","comments_url":"https://api.github.com/repos/twmb/nsq/comments{/number}","issue_comment_url":"https://api.github.com/repos/twmb/nsq/issues/comments{/number}","contents_url":"https://api.github.com/repos/twmb/nsq/contents/{+path}","compare_url":"https://api.github.com/repos/twmb/nsq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twmb/nsq/merges","archive_url":"https://api.github.com/repos/twmb/nsq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twmb/nsq/downloads","issues_url":"https://api.github.com/repos/twmb/nsq/issues{/number}","pulls_url":"https://api.github.com/repos/twmb/nsq/pulls{/number}","milestones_url":"https://api.github.com/repos/twmb/nsq/milestones{/number}","notifications_url":"https://api.github.com/repos/twmb/nsq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twmb/nsq/labels{/name}","releases_url":"https://api.github.com/repos/twmb/nsq/releases{/id}","created_at":"2014-10-15T00:25:46Z","updated_at":"2015-04-29T23:41:17Z","pushed_at":"2015-07-10T20:21:45Z","git_url":"git://github.com/twmb/nsq.git","ssh_url":"git@github.com:twmb/nsq.git","clone_url":"https://github.com/twmb/nsq.git","svn_url":"https://github.com/twmb/nsq","homepage":"http://nsq.io/","size":5870,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitly:master","ref":"master","sha":"213cd9d35e03044b22ebf12775521151993df650","user":{"login":"bitly","id":251133,"avatar_url":"https://avatars.githubusercontent.com/u/251133?v=3","gravatar_id":"","url":"https://api.github.com/users/bitly","html_url":"https://github.com/bitly","followers_url":"https://api.github.com/users/bitly/followers","following_url":"https://api.github.com/users/bitly/following{/other_user}","gists_url":"https://api.github.com/users/bitly/gists{/gist_id}","starred_url":"https://api.github.com/users/bitly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitly/subscriptions","organizations_url":"https://api.github.com/users/bitly/orgs","repos_url":"https://api.github.com/users/bitly/repos","events_url":"https://api.github.com/users/bitly/events{/privacy}","received_events_url":"https://api.github.com/users/bitly/received_events","type":"Organization","site_admin":false},"repo":{"id":4307108,"name":"nsq","full_name":"bitly/nsq","owner":{"login":"bitly","id":251133,"avatar_url":"https://avatars.githubusercontent.com/u/251133?v=3","gravatar_id":"","url":"https://api.github.com/users/bitly","html_url":"https://github.com/bitly","followers_url":"https://api.github.com/users/bitly/followers","following_url":"https://api.github.com/users/bitly/following{/other_user}","gists_url":"https://api.github.com/users/bitly/gists{/gist_id}","starred_url":"https://api.github.com/users/bitly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitly/subscriptions","organizations_url":"https://api.github.com/users/bitly/orgs","repos_url":"https://api.github.com/users/bitly/repos","events_url":"https://api.github.com/users/bitly/events{/privacy}","received_events_url":"https://api.github.com/users/bitly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitly/nsq","description":"A realtime distributed messaging platform","fork":false,"url":"https://api.github.com/repos/bitly/nsq","forks_url":"https://api.github.com/repos/bitly/nsq/forks","keys_url":"https://api.github.com/repos/bitly/nsq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitly/nsq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitly/nsq/teams","hooks_url":"https://api.github.com/repos/bitly/nsq/hooks","issue_events_url":"https://api.github.com/repos/bitly/nsq/issues/events{/number}","events_url":"https://api.github.com/repos/bitly/nsq/events","assignees_url":"https://api.github.com/repos/bitly/nsq/assignees{/user}","branches_url":"https://api.github.com/repos/bitly/nsq/branches{/branch}","tags_url":"https://api.github.com/repos/bitly/nsq/tags","blobs_url":"https://api.github.com/repos/bitly/nsq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitly/nsq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitly/nsq/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitly/nsq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitly/nsq/statuses/{sha}","languages_url":"https://api.github.com/repos/bitly/nsq/languages","stargazers_url":"https://api.github.com/repos/bitly/nsq/stargazers","contributors_url":"https://api.github.com/repos/bitly/nsq/contributors","subscribers_url":"https://api.github.com/repos/bitly/nsq/subscribers","subscription_url":"https://api.github.com/repos/bitly/nsq/subscription","commits_url":"https://api.github.com/repos/bitly/nsq/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitly/nsq/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitly/nsq/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitly/nsq/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitly/nsq/contents/{+path}","compare_url":"https://api.github.com/repos/bitly/nsq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitly/nsq/merges","archive_url":"https://api.github.com/repos/bitly/nsq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitly/nsq/downloads","issues_url":"https://api.github.com/repos/bitly/nsq/issues{/number}","pulls_url":"https://api.github.com/repos/bitly/nsq/pulls{/number}","milestones_url":"https://api.github.com/repos/bitly/nsq/milestones{/number}","notifications_url":"https://api.github.com/repos/bitly/nsq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitly/nsq/labels{/name}","releases_url":"https://api.github.com/repos/bitly/nsq/releases{/id}","created_at":"2012-05-12T14:37:08Z","updated_at":"2015-07-11T18:03:56Z","pushed_at":"2015-07-10T20:21:46Z","git_url":"git://github.com/bitly/nsq.git","ssh_url":"git@github.com:bitly/nsq.git","clone_url":"https://github.com/bitly/nsq.git","svn_url":"https://github.com/bitly/nsq","homepage":"http://nsq.io/","size":11948,"stargazers_count":5087,"watchers_count":5087,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":549,"mirror_url":null,"open_issues_count":40,"forks":549,"open_issues":40,"watchers":5087,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitly/nsq/pulls/600"},"html":{"href":"https://github.com/bitly/nsq/pull/600"},"issue":{"href":"https://api.github.com/repos/bitly/nsq/issues/600"},"comments":{"href":"https://api.github.com/repos/bitly/nsq/issues/600/comments"},"review_comments":{"href":"https://api.github.com/repos/bitly/nsq/pulls/600/comments"},"review_comment":{"href":"https://api.github.com/repos/bitly/nsq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitly/nsq/pulls/600/commits"},"statuses":{"href":"https://api.github.com/repos/bitly/nsq/statuses/1ce7fa22c0c8e43df5ba5a9ecd8a9ddd4c2cb465"}}}}