{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/heron/issues/1541","repository_url":"https://api.github.com/repos/twitter/heron","labels_url":"https://api.github.com/repos/twitter/heron/issues/1541/labels{/name}","comments_url":"https://api.github.com/repos/twitter/heron/issues/1541/comments","events_url":"https://api.github.com/repos/twitter/heron/issues/1541/events","html_url":"https://github.com/twitter/heron/pull/1541","id":188131576,"number":1541,"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},"labels":[{"id":265202765,"url":"https://api.github.com/repos/twitter/heron/labels/bug","name":"bug","color":"fc2929","default":true},{"id":419524893,"url":"https://api.github.com/repos/twitter/heron/labels/build","name":"build","color":"c2e0c6","default":false}],"state":"open","locked":false,"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":32,"state":"open","created_at":"2016-08-30T15:53:55Z","updated_at":"2016-11-08T23:23:22Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-11-08T23:23:22Z","updated_at":"2016-11-08T23:39:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/twitter/heron/pulls/1541","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"},"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."},"comment":{"url":"https://api.github.com/repos/twitter/heron/issues/comments/259294497","html_url":"https://github.com/twitter/heron/pull/1541#issuecomment-259294497","issue_url":"https://api.github.com/repos/twitter/heron/issues/1541","id":259294497,"user":{"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},"created_at":"2016-11-08T23:39:28Z","updated_at":"2016-11-08T23:39:28Z","body":"Good one! Thanks for fixing this."}}
{"actor":{"display_login":"kramasamy"}}