{"action":"created","comment":{"url":"https://api.github.com/repos/lookout/zipkin/pulls/comments/25220524","id":25220524,"diff_hunk":"@@ -9,13 +9,14 @@ package com.twitter.zipkin.storage.util\n  * supplied function is resilient to this fact.\n  */\n object Retry {\n-  def apply[T](n: Int)(f: => T) : T = {\n+  def apply[T](n: Int, sleep: Boolean = false)(f: => T) : T = {\n     var result:Option[T] = None\n     var throwable:Option[Throwable] = None\n \n     for (i <- 0 until n if result.isEmpty) {\n       try {\n         result = Option(f)\n+        if(sleep) Thread.sleep(1000)","path":"zipkin-common/src/main/scala/com/twitter/zipkin/storage/util/Retry.scala","position":12,"original_position":12,"commit_id":"da3eedf5f2fe89f329c9cfefbea6852239b9ad91","original_commit_id":"da3eedf5f2fe89f329c9cfefbea6852239b9ad91","user":{"login":"trane","id":36095,"avatar_url":"https://avatars.githubusercontent.com/u/36095?v=3","gravatar_id":"","url":"https://api.github.com/users/trane","html_url":"https://github.com/trane","followers_url":"https://api.github.com/users/trane/followers","following_url":"https://api.github.com/users/trane/following{/other_user}","gists_url":"https://api.github.com/users/trane/gists{/gist_id}","starred_url":"https://api.github.com/users/trane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trane/subscriptions","organizations_url":"https://api.github.com/users/trane/orgs","repos_url":"https://api.github.com/users/trane/repos","events_url":"https://api.github.com/users/trane/events{/privacy}","received_events_url":"https://api.github.com/users/trane/received_events","type":"User","site_admin":false},"body":"this will always sleep, even if f finishes.","created_at":"2015-02-24T01:18:03Z","updated_at":"2015-02-24T01:18:03Z","html_url":"https://github.com/lookout/zipkin/pull/11#discussion_r25220524","pull_request_url":"https://api.github.com/repos/lookout/zipkin/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/comments/25220524"},"html":{"href":"https://github.com/lookout/zipkin/pull/11#discussion_r25220524"},"pull_request":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/lookout/zipkin/pulls/11","id":29724854,"html_url":"https://github.com/lookout/zipkin/pull/11","diff_url":"https://github.com/lookout/zipkin/pull/11.diff","patch_url":"https://github.com/lookout/zipkin/pull/11.patch","issue_url":"https://api.github.com/repos/lookout/zipkin/issues/11","number":11,"state":"open","locked":false,"title":"Add wait to kafka stream processor","user":{"login":"jamescway","id":473680,"avatar_url":"https://avatars.githubusercontent.com/u/473680?v=3","gravatar_id":"","url":"https://api.github.com/users/jamescway","html_url":"https://github.com/jamescway","followers_url":"https://api.github.com/users/jamescway/followers","following_url":"https://api.github.com/users/jamescway/following{/other_user}","gists_url":"https://api.github.com/users/jamescway/gists{/gist_id}","starred_url":"https://api.github.com/users/jamescway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamescway/subscriptions","organizations_url":"https://api.github.com/users/jamescway/orgs","repos_url":"https://api.github.com/users/jamescway/repos","events_url":"https://api.github.com/users/jamescway/events{/privacy}","received_events_url":"https://api.github.com/users/jamescway/received_events","type":"User","site_admin":false},"body":"During a load test the kafka consumer consumed messages at a rate faster than the ItemQueue could consume.  The blocking queue would throw ```QueueFullException``` and it was caught in a try/catch block.  Here we retry 5 times waiting 1 second in between attempts.","created_at":"2015-02-20T19:45:37Z","updated_at":"2015-02-24T01:18:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"794d262d1b101c87b89d1a561d70908ca46f5ac2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lookout/zipkin/pulls/11/commits","review_comments_url":"https://api.github.com/repos/lookout/zipkin/pulls/11/comments","review_comment_url":"https://api.github.com/repos/lookout/zipkin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lookout/zipkin/issues/11/comments","statuses_url":"https://api.github.com/repos/lookout/zipkin/statuses/da3eedf5f2fe89f329c9cfefbea6852239b9ad91","head":{"label":"lookout:add-wait","ref":"add-wait","sha":"da3eedf5f2fe89f329c9cfefbea6852239b9ad91","user":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"repo":{"id":22450363,"name":"zipkin","full_name":"lookout/zipkin","owner":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lookout/zipkin","description":"Zipkin is a distributed tracing system","fork":true,"url":"https://api.github.com/repos/lookout/zipkin","forks_url":"https://api.github.com/repos/lookout/zipkin/forks","keys_url":"https://api.github.com/repos/lookout/zipkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookout/zipkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookout/zipkin/teams","hooks_url":"https://api.github.com/repos/lookout/zipkin/hooks","issue_events_url":"https://api.github.com/repos/lookout/zipkin/issues/events{/number}","events_url":"https://api.github.com/repos/lookout/zipkin/events","assignees_url":"https://api.github.com/repos/lookout/zipkin/assignees{/user}","branches_url":"https://api.github.com/repos/lookout/zipkin/branches{/branch}","tags_url":"https://api.github.com/repos/lookout/zipkin/tags","blobs_url":"https://api.github.com/repos/lookout/zipkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookout/zipkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookout/zipkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookout/zipkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookout/zipkin/statuses/{sha}","languages_url":"https://api.github.com/repos/lookout/zipkin/languages","stargazers_url":"https://api.github.com/repos/lookout/zipkin/stargazers","contributors_url":"https://api.github.com/repos/lookout/zipkin/contributors","subscribers_url":"https://api.github.com/repos/lookout/zipkin/subscribers","subscription_url":"https://api.github.com/repos/lookout/zipkin/subscription","commits_url":"https://api.github.com/repos/lookout/zipkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookout/zipkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookout/zipkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookout/zipkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookout/zipkin/contents/{+path}","compare_url":"https://api.github.com/repos/lookout/zipkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookout/zipkin/merges","archive_url":"https://api.github.com/repos/lookout/zipkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookout/zipkin/downloads","issues_url":"https://api.github.com/repos/lookout/zipkin/issues{/number}","pulls_url":"https://api.github.com/repos/lookout/zipkin/pulls{/number}","milestones_url":"https://api.github.com/repos/lookout/zipkin/milestones{/number}","notifications_url":"https://api.github.com/repos/lookout/zipkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookout/zipkin/labels{/name}","releases_url":"https://api.github.com/repos/lookout/zipkin/releases{/id}","created_at":"2014-07-31T00:41:34Z","updated_at":"2015-02-11T22:41:01Z","pushed_at":"2015-02-24T00:45:52Z","git_url":"git://github.com/lookout/zipkin.git","ssh_url":"git@github.com:lookout/zipkin.git","clone_url":"https://github.com/lookout/zipkin.git","svn_url":"https://github.com/lookout/zipkin","homepage":"http://twitter.github.io/zipkin","size":3845,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"lookout"}},"base":{"label":"lookout:lookout","ref":"lookout","sha":"9c7c3d404f335398011684ed7bdf9328442b79c4","user":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"repo":{"id":22450363,"name":"zipkin","full_name":"lookout/zipkin","owner":{"login":"lookout","id":47237,"avatar_url":"https://avatars.githubusercontent.com/u/47237?v=3","gravatar_id":"","url":"https://api.github.com/users/lookout","html_url":"https://github.com/lookout","followers_url":"https://api.github.com/users/lookout/followers","following_url":"https://api.github.com/users/lookout/following{/other_user}","gists_url":"https://api.github.com/users/lookout/gists{/gist_id}","starred_url":"https://api.github.com/users/lookout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookout/subscriptions","organizations_url":"https://api.github.com/users/lookout/orgs","repos_url":"https://api.github.com/users/lookout/repos","events_url":"https://api.github.com/users/lookout/events{/privacy}","received_events_url":"https://api.github.com/users/lookout/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lookout/zipkin","description":"Zipkin is a distributed tracing system","fork":true,"url":"https://api.github.com/repos/lookout/zipkin","forks_url":"https://api.github.com/repos/lookout/zipkin/forks","keys_url":"https://api.github.com/repos/lookout/zipkin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookout/zipkin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookout/zipkin/teams","hooks_url":"https://api.github.com/repos/lookout/zipkin/hooks","issue_events_url":"https://api.github.com/repos/lookout/zipkin/issues/events{/number}","events_url":"https://api.github.com/repos/lookout/zipkin/events","assignees_url":"https://api.github.com/repos/lookout/zipkin/assignees{/user}","branches_url":"https://api.github.com/repos/lookout/zipkin/branches{/branch}","tags_url":"https://api.github.com/repos/lookout/zipkin/tags","blobs_url":"https://api.github.com/repos/lookout/zipkin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookout/zipkin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookout/zipkin/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookout/zipkin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookout/zipkin/statuses/{sha}","languages_url":"https://api.github.com/repos/lookout/zipkin/languages","stargazers_url":"https://api.github.com/repos/lookout/zipkin/stargazers","contributors_url":"https://api.github.com/repos/lookout/zipkin/contributors","subscribers_url":"https://api.github.com/repos/lookout/zipkin/subscribers","subscription_url":"https://api.github.com/repos/lookout/zipkin/subscription","commits_url":"https://api.github.com/repos/lookout/zipkin/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookout/zipkin/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookout/zipkin/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookout/zipkin/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookout/zipkin/contents/{+path}","compare_url":"https://api.github.com/repos/lookout/zipkin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookout/zipkin/merges","archive_url":"https://api.github.com/repos/lookout/zipkin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookout/zipkin/downloads","issues_url":"https://api.github.com/repos/lookout/zipkin/issues{/number}","pulls_url":"https://api.github.com/repos/lookout/zipkin/pulls{/number}","milestones_url":"https://api.github.com/repos/lookout/zipkin/milestones{/number}","notifications_url":"https://api.github.com/repos/lookout/zipkin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookout/zipkin/labels{/name}","releases_url":"https://api.github.com/repos/lookout/zipkin/releases{/id}","created_at":"2014-07-31T00:41:34Z","updated_at":"2015-02-11T22:41:01Z","pushed_at":"2015-02-24T00:45:52Z","git_url":"git://github.com/lookout/zipkin.git","ssh_url":"git@github.com:lookout/zipkin.git","clone_url":"https://github.com/lookout/zipkin.git","svn_url":"https://github.com/lookout/zipkin","homepage":"http://twitter.github.io/zipkin","size":3845,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"lookout"}},"_links":{"self":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/11"},"html":{"href":"https://github.com/lookout/zipkin/pull/11"},"issue":{"href":"https://api.github.com/repos/lookout/zipkin/issues/11"},"comments":{"href":"https://api.github.com/repos/lookout/zipkin/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lookout/zipkin/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/lookout/zipkin/statuses/da3eedf5f2fe89f329c9cfefbea6852239b9ad91"}}}}