{"action":"closed","number":1541,"pull_request":{"url":"https://api.github.com/repos/twitter/heron/pulls/1541","id":92879844,"html_url":"https://github.com/twitter/heron/pull/1541","diff_url":"https://github.com/twitter/heron/pull/1541.diff","patch_url":"https://github.com/twitter/heron/pull/1541.patch","issue_url":"https://api.github.com/repos/twitter/heron/issues/1541","number":1541,"state":"closed","locked":false,"title":"Use pipe to properly block clients when server hasn't entered event loop.","user":{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false},"body":"The previous way of using `usleep` cannot guarantee the clients are blocked when server hasn't entered event loop, which makes``heron/common/tests/cpp/network:http_unittest`` flaky.\r\n\r\nThis PR switches to using pipe. Server will send a byte to pipe prior to entering event loop. Clients will wait(block) until the byte is read on the other side of the pipe. This makes sure that clients are properly blocked.\r\n\r\nTest done via script\r\n```Bash\r\n#!/bin/sh\r\n\r\nfor i in `seq 1 1000`;\r\ndo\r\n    bazel test --config=darwin --no_cache_test_results heron/common/tests/cpp/network:http_unittest\r\n    if [[ $? != 0 ]]; then\r\n      exit 1\r\n    fi\r\ndone\r\n```\r\n\r\nThanks @congwang for suggestions.","created_at":"2016-11-08T23:23:22Z","updated_at":"2016-11-10T02:31:05Z","closed_at":"2016-11-10T02:31:05Z","merged_at":"2016-11-10T02:31:05Z","merge_commit_sha":"7aebdf65fc387269a2a74ec6eb6108610240d736","assignee":{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false},"assignees":[{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/twitter/heron/milestones/9","html_url":"https://github.com/twitter/heron/milestones/0.14.5","labels_url":"https://api.github.com/repos/twitter/heron/milestones/9/labels","id":1972930,"number":9,"title":"0.14.5","description":"","creator":{"login":"kramasamy","id":367684,"avatar_url":"https://avatars.githubusercontent.com/u/367684?v=3","gravatar_id":"","url":"https://api.github.com/users/kramasamy","html_url":"https://github.com/kramasamy","followers_url":"https://api.github.com/users/kramasamy/followers","following_url":"https://api.github.com/users/kramasamy/following{/other_user}","gists_url":"https://api.github.com/users/kramasamy/gists{/gist_id}","starred_url":"https://api.github.com/users/kramasamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kramasamy/subscriptions","organizations_url":"https://api.github.com/users/kramasamy/orgs","repos_url":"https://api.github.com/users/kramasamy/repos","events_url":"https://api.github.com/users/kramasamy/events{/privacy}","received_events_url":"https://api.github.com/users/kramasamy/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":35,"state":"open","created_at":"2016-08-30T15:53:55Z","updated_at":"2016-11-10T02:31:05Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/twitter/heron/pulls/1541/commits","review_comments_url":"https://api.github.com/repos/twitter/heron/pulls/1541/comments","review_comment_url":"https://api.github.com/repos/twitter/heron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/heron/issues/1541/comments","statuses_url":"https://api.github.com/repos/twitter/heron/statuses/dc185672ac8d8b9bd773ecf9246c4a32ef6a3bc0","head":{"label":"objmagic:flaky_http_unittest","ref":"flaky_http_unittest","sha":"dc185672ac8d8b9bd773ecf9246c4a32ef6a3bc0","user":{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false},"repo":{"id":59701078,"name":"heron","full_name":"objmagic/heron","owner":{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/objmagic/heron","description":"Heron is a realtime, distributed, fault-tolerant stream processing engine from Twitter","fork":true,"url":"https://api.github.com/repos/objmagic/heron","forks_url":"https://api.github.com/repos/objmagic/heron/forks","keys_url":"https://api.github.com/repos/objmagic/heron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/objmagic/heron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/objmagic/heron/teams","hooks_url":"https://api.github.com/repos/objmagic/heron/hooks","issue_events_url":"https://api.github.com/repos/objmagic/heron/issues/events{/number}","events_url":"https://api.github.com/repos/objmagic/heron/events","assignees_url":"https://api.github.com/repos/objmagic/heron/assignees{/user}","branches_url":"https://api.github.com/repos/objmagic/heron/branches{/branch}","tags_url":"https://api.github.com/repos/objmagic/heron/tags","blobs_url":"https://api.github.com/repos/objmagic/heron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/objmagic/heron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/objmagic/heron/git/refs{/sha}","trees_url":"https://api.github.com/repos/objmagic/heron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/objmagic/heron/statuses/{sha}","languages_url":"https://api.github.com/repos/objmagic/heron/languages","stargazers_url":"https://api.github.com/repos/objmagic/heron/stargazers","contributors_url":"https://api.github.com/repos/objmagic/heron/contributors","subscribers_url":"https://api.github.com/repos/objmagic/heron/subscribers","subscription_url":"https://api.github.com/repos/objmagic/heron/subscription","commits_url":"https://api.github.com/repos/objmagic/heron/commits{/sha}","git_commits_url":"https://api.github.com/repos/objmagic/heron/git/commits{/sha}","comments_url":"https://api.github.com/repos/objmagic/heron/comments{/number}","issue_comment_url":"https://api.github.com/repos/objmagic/heron/issues/comments{/number}","contents_url":"https://api.github.com/repos/objmagic/heron/contents/{+path}","compare_url":"https://api.github.com/repos/objmagic/heron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/objmagic/heron/merges","archive_url":"https://api.github.com/repos/objmagic/heron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/objmagic/heron/downloads","issues_url":"https://api.github.com/repos/objmagic/heron/issues{/number}","pulls_url":"https://api.github.com/repos/objmagic/heron/pulls{/number}","milestones_url":"https://api.github.com/repos/objmagic/heron/milestones{/number}","notifications_url":"https://api.github.com/repos/objmagic/heron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/objmagic/heron/labels{/name}","releases_url":"https://api.github.com/repos/objmagic/heron/releases{/id}","deployments_url":"https://api.github.com/repos/objmagic/heron/deployments","created_at":"2016-05-25T22:08:44Z","updated_at":"2016-09-08T23:53:46Z","pushed_at":"2016-11-08T23:58:04Z","git_url":"git://github.com/objmagic/heron.git","ssh_url":"git@github.com:objmagic/heron.git","clone_url":"https://github.com/objmagic/heron.git","svn_url":"https://github.com/objmagic/heron","homepage":"http://heronstreaming.io","size":119189,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"twitter:master","ref":"master","sha":"3bd2f4cf3abbfab15584aee3525d5d58d4c36706","user":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":43158694,"name":"heron","full_name":"twitter/heron","owner":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/heron","description":"Heron is a realtime, distributed, fault-tolerant stream processing engine from Twitter","fork":false,"url":"https://api.github.com/repos/twitter/heron","forks_url":"https://api.github.com/repos/twitter/heron/forks","keys_url":"https://api.github.com/repos/twitter/heron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/heron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/heron/teams","hooks_url":"https://api.github.com/repos/twitter/heron/hooks","issue_events_url":"https://api.github.com/repos/twitter/heron/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/heron/events","assignees_url":"https://api.github.com/repos/twitter/heron/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/heron/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/heron/tags","blobs_url":"https://api.github.com/repos/twitter/heron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/heron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/heron/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/heron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/heron/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/heron/languages","stargazers_url":"https://api.github.com/repos/twitter/heron/stargazers","contributors_url":"https://api.github.com/repos/twitter/heron/contributors","subscribers_url":"https://api.github.com/repos/twitter/heron/subscribers","subscription_url":"https://api.github.com/repos/twitter/heron/subscription","commits_url":"https://api.github.com/repos/twitter/heron/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/heron/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/heron/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/heron/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/heron/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/heron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/heron/merges","archive_url":"https://api.github.com/repos/twitter/heron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/heron/downloads","issues_url":"https://api.github.com/repos/twitter/heron/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/heron/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/heron/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/heron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/heron/labels{/name}","releases_url":"https://api.github.com/repos/twitter/heron/releases{/id}","deployments_url":"https://api.github.com/repos/twitter/heron/deployments","created_at":"2015-09-25T16:09:24Z","updated_at":"2016-11-09T20:11:37Z","pushed_at":"2016-11-10T02:31:05Z","git_url":"git://github.com/twitter/heron.git","ssh_url":"git@github.com:twitter/heron.git","clone_url":"https://github.com/twitter/heron.git","svn_url":"https://github.com/twitter/heron","homepage":"http://heronstreaming.io","size":148011,"stargazers_count":2493,"watchers_count":2493,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":422,"mirror_url":null,"open_issues_count":204,"forks":422,"open_issues":204,"watchers":2493,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/heron/pulls/1541"},"html":{"href":"https://github.com/twitter/heron/pull/1541"},"issue":{"href":"https://api.github.com/repos/twitter/heron/issues/1541"},"comments":{"href":"https://api.github.com/repos/twitter/heron/issues/1541/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/heron/pulls/1541/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/heron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/heron/pulls/1541/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/heron/statuses/dc185672ac8d8b9bd773ecf9246c4a32ef6a3bc0"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"objmagic","id":3656079,"avatar_url":"https://avatars.githubusercontent.com/u/3656079?v=3","gravatar_id":"","url":"https://api.github.com/users/objmagic","html_url":"https://github.com/objmagic","followers_url":"https://api.github.com/users/objmagic/followers","following_url":"https://api.github.com/users/objmagic/following{/other_user}","gists_url":"https://api.github.com/users/objmagic/gists{/gist_id}","starred_url":"https://api.github.com/users/objmagic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objmagic/subscriptions","organizations_url":"https://api.github.com/users/objmagic/orgs","repos_url":"https://api.github.com/users/objmagic/repos","events_url":"https://api.github.com/users/objmagic/events{/privacy}","received_events_url":"https://api.github.com/users/objmagic/received_events","type":"User","site_admin":false},"comments":3,"review_comments":6,"commits":4,"additions":20,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"objmagic"}}