{"action":"created","comment":{"url":"https://api.github.com/repos/btccom/btcpool/pulls/comments/219020411","pull_request_review_id":157090306,"id":219020411,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTAyMDQxMQ==","diff_hunk":"@@ -147,30 +147,34 @@ void JobMaker::produceStratumJob() {\n }\n \n void JobMaker::runThreadKafkaConsume(JobMakerConsumerHandler &consumerHandler) {\n-  const int32_t timeoutMs = 1000;\n+  int32_t timeoutMs = handler_->def()->jobInterval_ * 1000;\n \n   while (running_) {\n     rd_kafka_message_t *rkmessage;\n     rkmessage = consumerHandler.kafkaConsumer_->consumer(timeoutMs);\n-    if (rkmessage == nullptr) /* timeout */ {\n-      continue;\n+    if (rkmessage == nullptr || time(nullptr) - lastJobTime_ > handler_->def()->jobInterval_) /* timeout */ {","path":"src/JobMaker.cc","position":12,"original_position":12,"commit_id":"1025e07c99316eb6f60dccfb3059639a3c325fdc","original_commit_id":"1025e07c99316eb6f60dccfb3059639a3c325fdc","user":{"login":"YihaoPeng","id":26923506,"node_id":"MDQ6VXNlcjI2OTIzNTA2","avatar_url":"https://avatars0.githubusercontent.com/u/26923506?v=4","gravatar_id":"","url":"https://api.github.com/users/YihaoPeng","html_url":"https://github.com/YihaoPeng","followers_url":"https://api.github.com/users/YihaoPeng/followers","following_url":"https://api.github.com/users/YihaoPeng/following{/other_user}","gists_url":"https://api.github.com/users/YihaoPeng/gists{/gist_id}","starred_url":"https://api.github.com/users/YihaoPeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YihaoPeng/subscriptions","organizations_url":"https://api.github.com/users/YihaoPeng/orgs","repos_url":"https://api.github.com/users/YihaoPeng/repos","events_url":"https://api.github.com/users/YihaoPeng/events{/privacy}","received_events_url":"https://api.github.com/users/YihaoPeng/received_events","type":"User","site_admin":false},"body":"我感觉monotonic clock没有太大的必要。目前的job id生成方式要求系统时间是准确的，否则bitcoin sserver会认为任务太老而拒绝接受。","created_at":"2018-09-20T02:45:55Z","updated_at":"2018-09-20T02:45:55Z","html_url":"https://github.com/btccom/btcpool/pull/141#discussion_r219020411","pull_request_url":"https://api.github.com/repos/btccom/btcpool/pulls/141","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/comments/219020411"},"html":{"href":"https://github.com/btccom/btcpool/pull/141#discussion_r219020411"},"pull_request":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/141"}},"in_reply_to_id":218755491},"pull_request":{"url":"https://api.github.com/repos/btccom/btcpool/pulls/141","id":216524613,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NTI0NjEz","html_url":"https://github.com/btccom/btcpool/pull/141","diff_url":"https://github.com/btccom/btcpool/pull/141.diff","patch_url":"https://github.com/btccom/btcpool/pull/141.patch","issue_url":"https://api.github.com/repos/btccom/btcpool/issues/141","number":141,"state":"open","locked":false,"title":"Remove job maker kafka consumer/producer locks","user":{"login":"bitmainhjyu","id":42531996,"node_id":"MDQ6VXNlcjQyNTMxOTk2","avatar_url":"https://avatars2.githubusercontent.com/u/42531996?v=4","gravatar_id":"","url":"https://api.github.com/users/bitmainhjyu","html_url":"https://github.com/bitmainhjyu","followers_url":"https://api.github.com/users/bitmainhjyu/followers","following_url":"https://api.github.com/users/bitmainhjyu/following{/other_user}","gists_url":"https://api.github.com/users/bitmainhjyu/gists{/gist_id}","starred_url":"https://api.github.com/users/bitmainhjyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitmainhjyu/subscriptions","organizations_url":"https://api.github.com/users/bitmainhjyu/orgs","repos_url":"https://api.github.com/users/bitmainhjyu/repos","events_url":"https://api.github.com/users/bitmainhjyu/events{/privacy}","received_events_url":"https://api.github.com/users/bitmainhjyu/received_events","type":"User","site_admin":false},"body":"Use the timeout value in kafka consumer call to trigger the stratum job\r\nproducing. It will be running in kafka consumer thread so no explicit\r\nlocks are required. Note that if 2 consumers are sharing same resources\r\nthey still have to be properly handled.","created_at":"2018-09-19T06:13:18Z","updated_at":"2018-09-20T02:45:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8eb7f540e88ad4cfeb18cbfa122d3ab88d3ce1c0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/btccom/btcpool/pulls/141/commits","review_comments_url":"https://api.github.com/repos/btccom/btcpool/pulls/141/comments","review_comment_url":"https://api.github.com/repos/btccom/btcpool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/btccom/btcpool/issues/141/comments","statuses_url":"https://api.github.com/repos/btccom/btcpool/statuses/1025e07c99316eb6f60dccfb3059639a3c325fdc","head":{"label":"btccom:deveth-jobmaker-lock","ref":"deveth-jobmaker-lock","sha":"1025e07c99316eb6f60dccfb3059639a3c325fdc","user":{"login":"btccom","id":16893897,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODkzODk3","avatar_url":"https://avatars3.githubusercontent.com/u/16893897?v=4","gravatar_id":"","url":"https://api.github.com/users/btccom","html_url":"https://github.com/btccom","followers_url":"https://api.github.com/users/btccom/followers","following_url":"https://api.github.com/users/btccom/following{/other_user}","gists_url":"https://api.github.com/users/btccom/gists{/gist_id}","starred_url":"https://api.github.com/users/btccom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btccom/subscriptions","organizations_url":"https://api.github.com/users/btccom/orgs","repos_url":"https://api.github.com/users/btccom/repos","events_url":"https://api.github.com/users/btccom/events{/privacy}","received_events_url":"https://api.github.com/users/btccom/received_events","type":"Organization","site_admin":false},"repo":{"id":65787244,"node_id":"MDEwOlJlcG9zaXRvcnk2NTc4NzI0NA==","name":"btcpool","full_name":"btccom/btcpool","private":false,"owner":{"login":"btccom","id":16893897,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODkzODk3","avatar_url":"https://avatars3.githubusercontent.com/u/16893897?v=4","gravatar_id":"","url":"https://api.github.com/users/btccom","html_url":"https://github.com/btccom","followers_url":"https://api.github.com/users/btccom/followers","following_url":"https://api.github.com/users/btccom/following{/other_user}","gists_url":"https://api.github.com/users/btccom/gists{/gist_id}","starred_url":"https://api.github.com/users/btccom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btccom/subscriptions","organizations_url":"https://api.github.com/users/btccom/orgs","repos_url":"https://api.github.com/users/btccom/repos","events_url":"https://api.github.com/users/btccom/events{/privacy}","received_events_url":"https://api.github.com/users/btccom/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/btccom/btcpool","description":"backend of pool.btc.com","fork":false,"url":"https://api.github.com/repos/btccom/btcpool","forks_url":"https://api.github.com/repos/btccom/btcpool/forks","keys_url":"https://api.github.com/repos/btccom/btcpool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btccom/btcpool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btccom/btcpool/teams","hooks_url":"https://api.github.com/repos/btccom/btcpool/hooks","issue_events_url":"https://api.github.com/repos/btccom/btcpool/issues/events{/number}","events_url":"https://api.github.com/repos/btccom/btcpool/events","assignees_url":"https://api.github.com/repos/btccom/btcpool/assignees{/user}","branches_url":"https://api.github.com/repos/btccom/btcpool/branches{/branch}","tags_url":"https://api.github.com/repos/btccom/btcpool/tags","blobs_url":"https://api.github.com/repos/btccom/btcpool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btccom/btcpool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btccom/btcpool/git/refs{/sha}","trees_url":"https://api.github.com/repos/btccom/btcpool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btccom/btcpool/statuses/{sha}","languages_url":"https://api.github.com/repos/btccom/btcpool/languages","stargazers_url":"https://api.github.com/repos/btccom/btcpool/stargazers","contributors_url":"https://api.github.com/repos/btccom/btcpool/contributors","subscribers_url":"https://api.github.com/repos/btccom/btcpool/subscribers","subscription_url":"https://api.github.com/repos/btccom/btcpool/subscription","commits_url":"https://api.github.com/repos/btccom/btcpool/commits{/sha}","git_commits_url":"https://api.github.com/repos/btccom/btcpool/git/commits{/sha}","comments_url":"https://api.github.com/repos/btccom/btcpool/comments{/number}","issue_comment_url":"https://api.github.com/repos/btccom/btcpool/issues/comments{/number}","contents_url":"https://api.github.com/repos/btccom/btcpool/contents/{+path}","compare_url":"https://api.github.com/repos/btccom/btcpool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btccom/btcpool/merges","archive_url":"https://api.github.com/repos/btccom/btcpool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btccom/btcpool/downloads","issues_url":"https://api.github.com/repos/btccom/btcpool/issues{/number}","pulls_url":"https://api.github.com/repos/btccom/btcpool/pulls{/number}","milestones_url":"https://api.github.com/repos/btccom/btcpool/milestones{/number}","notifications_url":"https://api.github.com/repos/btccom/btcpool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btccom/btcpool/labels{/name}","releases_url":"https://api.github.com/repos/btccom/btcpool/releases{/id}","deployments_url":"https://api.github.com/repos/btccom/btcpool/deployments","created_at":"2016-08-16T04:22:06Z","updated_at":"2018-09-17T19:44:01Z","pushed_at":"2018-09-19T11:11:46Z","git_url":"git://github.com/btccom/btcpool.git","ssh_url":"git@github.com:btccom/btcpool.git","clone_url":"https://github.com/btccom/btcpool.git","svn_url":"https://github.com/btccom/btcpool","homepage":"https://pool.btc.com","size":18169,"stargazers_count":289,"watchers_count":289,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":172,"open_issues":5,"watchers":289,"default_branch":"master"}},"base":{"label":"btccom:deveth","ref":"deveth","sha":"645dfc026f1fb11b2efeb2b5479008f8f02a5659","user":{"login":"btccom","id":16893897,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODkzODk3","avatar_url":"https://avatars3.githubusercontent.com/u/16893897?v=4","gravatar_id":"","url":"https://api.github.com/users/btccom","html_url":"https://github.com/btccom","followers_url":"https://api.github.com/users/btccom/followers","following_url":"https://api.github.com/users/btccom/following{/other_user}","gists_url":"https://api.github.com/users/btccom/gists{/gist_id}","starred_url":"https://api.github.com/users/btccom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btccom/subscriptions","organizations_url":"https://api.github.com/users/btccom/orgs","repos_url":"https://api.github.com/users/btccom/repos","events_url":"https://api.github.com/users/btccom/events{/privacy}","received_events_url":"https://api.github.com/users/btccom/received_events","type":"Organization","site_admin":false},"repo":{"id":65787244,"node_id":"MDEwOlJlcG9zaXRvcnk2NTc4NzI0NA==","name":"btcpool","full_name":"btccom/btcpool","private":false,"owner":{"login":"btccom","id":16893897,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODkzODk3","avatar_url":"https://avatars3.githubusercontent.com/u/16893897?v=4","gravatar_id":"","url":"https://api.github.com/users/btccom","html_url":"https://github.com/btccom","followers_url":"https://api.github.com/users/btccom/followers","following_url":"https://api.github.com/users/btccom/following{/other_user}","gists_url":"https://api.github.com/users/btccom/gists{/gist_id}","starred_url":"https://api.github.com/users/btccom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btccom/subscriptions","organizations_url":"https://api.github.com/users/btccom/orgs","repos_url":"https://api.github.com/users/btccom/repos","events_url":"https://api.github.com/users/btccom/events{/privacy}","received_events_url":"https://api.github.com/users/btccom/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/btccom/btcpool","description":"backend of pool.btc.com","fork":false,"url":"https://api.github.com/repos/btccom/btcpool","forks_url":"https://api.github.com/repos/btccom/btcpool/forks","keys_url":"https://api.github.com/repos/btccom/btcpool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btccom/btcpool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btccom/btcpool/teams","hooks_url":"https://api.github.com/repos/btccom/btcpool/hooks","issue_events_url":"https://api.github.com/repos/btccom/btcpool/issues/events{/number}","events_url":"https://api.github.com/repos/btccom/btcpool/events","assignees_url":"https://api.github.com/repos/btccom/btcpool/assignees{/user}","branches_url":"https://api.github.com/repos/btccom/btcpool/branches{/branch}","tags_url":"https://api.github.com/repos/btccom/btcpool/tags","blobs_url":"https://api.github.com/repos/btccom/btcpool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btccom/btcpool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btccom/btcpool/git/refs{/sha}","trees_url":"https://api.github.com/repos/btccom/btcpool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btccom/btcpool/statuses/{sha}","languages_url":"https://api.github.com/repos/btccom/btcpool/languages","stargazers_url":"https://api.github.com/repos/btccom/btcpool/stargazers","contributors_url":"https://api.github.com/repos/btccom/btcpool/contributors","subscribers_url":"https://api.github.com/repos/btccom/btcpool/subscribers","subscription_url":"https://api.github.com/repos/btccom/btcpool/subscription","commits_url":"https://api.github.com/repos/btccom/btcpool/commits{/sha}","git_commits_url":"https://api.github.com/repos/btccom/btcpool/git/commits{/sha}","comments_url":"https://api.github.com/repos/btccom/btcpool/comments{/number}","issue_comment_url":"https://api.github.com/repos/btccom/btcpool/issues/comments{/number}","contents_url":"https://api.github.com/repos/btccom/btcpool/contents/{+path}","compare_url":"https://api.github.com/repos/btccom/btcpool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btccom/btcpool/merges","archive_url":"https://api.github.com/repos/btccom/btcpool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btccom/btcpool/downloads","issues_url":"https://api.github.com/repos/btccom/btcpool/issues{/number}","pulls_url":"https://api.github.com/repos/btccom/btcpool/pulls{/number}","milestones_url":"https://api.github.com/repos/btccom/btcpool/milestones{/number}","notifications_url":"https://api.github.com/repos/btccom/btcpool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btccom/btcpool/labels{/name}","releases_url":"https://api.github.com/repos/btccom/btcpool/releases{/id}","deployments_url":"https://api.github.com/repos/btccom/btcpool/deployments","created_at":"2016-08-16T04:22:06Z","updated_at":"2018-09-17T19:44:01Z","pushed_at":"2018-09-19T11:11:46Z","git_url":"git://github.com/btccom/btcpool.git","ssh_url":"git@github.com:btccom/btcpool.git","clone_url":"https://github.com/btccom/btcpool.git","svn_url":"https://github.com/btccom/btcpool","homepage":"https://pool.btc.com","size":18169,"stargazers_count":289,"watchers_count":289,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":172,"open_issues":5,"watchers":289,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/141"},"html":{"href":"https://github.com/btccom/btcpool/pull/141"},"issue":{"href":"https://api.github.com/repos/btccom/btcpool/issues/141"},"comments":{"href":"https://api.github.com/repos/btccom/btcpool/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/btccom/btcpool/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/btccom/btcpool/statuses/1025e07c99316eb6f60dccfb3059639a3c325fdc"}},"author_association":"NONE"}}
{"actor":{"display_login":"YihaoPeng"}}