{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/comments/175773112","pull_request_review_id":105356593,"id":175773112,"diff_hunk":"@@ -158,18 +144,18 @@ impl<T: Display> Scheduler<T> {\n     /// If the worker is stopped or number pending tasks exceeds capacity, an error will return.\n     pub fn schedule(&self, task: T) -> Result<(), ScheduleError<T>> {\n         debug!(\"scheduling task {}\", task);\n-        match self.sender {\n-            TaskSender::Unbounded(ref tx) => if let Err(SendError(Some(t))) = tx.send(Some(task)) {\n+        // whether sender is bounded or not\n+        if self.sender.capacity().is_none() {","path":"src/util/worker/mod.rs","position":56,"original_position":56,"commit_id":"5c754e9cb687ace3a3fdcaaf292ee841c12ea01b","original_commit_id":"5c754e9cb687ace3a3fdcaaf292ee841c12ea01b","user":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"body":"Previously we use `try_send` only when `sender` is bounded.","created_at":"2018-03-20T13:55:59Z","updated_at":"2018-03-20T13:55:59Z","html_url":"https://github.com/pingcap/tikv/pull/2846#discussion_r175773112","pull_request_url":"https://api.github.com/repos/pingcap/tikv/pulls/2846","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments/175773112"},"html":{"href":"https://github.com/pingcap/tikv/pull/2846#discussion_r175773112"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2846"}},"in_reply_to_id":175770436},"pull_request":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/2846","id":176101080,"html_url":"https://github.com/pingcap/tikv/pull/2846","diff_url":"https://github.com/pingcap/tikv/pull/2846.diff","patch_url":"https://github.com/pingcap/tikv/pull/2846.patch","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/2846","number":2846,"state":"open","locked":false,"title":"util: refactor worker with crossbeam-channel","user":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-20T06:41:09Z","updated_at":"2018-03-20T13:55:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6608032c2a51ced40c0071a9735267a761cf049b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"hicqu","id":8407317,"avatar_url":"https://avatars1.githubusercontent.com/u/8407317?v=4","gravatar_id":"","url":"https://api.github.com/users/hicqu","html_url":"https://github.com/hicqu","followers_url":"https://api.github.com/users/hicqu/followers","following_url":"https://api.github.com/users/hicqu/following{/other_user}","gists_url":"https://api.github.com/users/hicqu/gists{/gist_id}","starred_url":"https://api.github.com/users/hicqu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hicqu/subscriptions","organizations_url":"https://api.github.com/users/hicqu/orgs","repos_url":"https://api.github.com/users/hicqu/repos","events_url":"https://api.github.com/users/hicqu/events{/privacy}","received_events_url":"https://api.github.com/users/hicqu/received_events","type":"User","site_admin":false},{"login":"zhangjinpeng1987","id":19700528,"avatar_url":"https://avatars2.githubusercontent.com/u/19700528?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangjinpeng1987","html_url":"https://github.com/zhangjinpeng1987","followers_url":"https://api.github.com/users/zhangjinpeng1987/followers","following_url":"https://api.github.com/users/zhangjinpeng1987/following{/other_user}","gists_url":"https://api.github.com/users/zhangjinpeng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangjinpeng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangjinpeng1987/subscriptions","organizations_url":"https://api.github.com/users/zhangjinpeng1987/orgs","repos_url":"https://api.github.com/users/zhangjinpeng1987/repos","events_url":"https://api.github.com/users/zhangjinpeng1987/events{/privacy}","received_events_url":"https://api.github.com/users/zhangjinpeng1987/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tikv/pulls/2846/commits","review_comments_url":"https://api.github.com/repos/pingcap/tikv/pulls/2846/comments","review_comment_url":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/2846/comments","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/5c754e9cb687ace3a3fdcaaf292ee841c12ea01b","head":{"label":"UncP:uncp/use-crossbeam","ref":"uncp/use-crossbeam","sha":"5c754e9cb687ace3a3fdcaaf292ee841c12ea01b","user":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"repo":{"id":112136423,"name":"tikv","full_name":"UncP/tikv","owner":{"login":"UncP","id":16263931,"avatar_url":"https://avatars1.githubusercontent.com/u/16263931?v=4","gravatar_id":"","url":"https://api.github.com/users/UncP","html_url":"https://github.com/UncP","followers_url":"https://api.github.com/users/UncP/followers","following_url":"https://api.github.com/users/UncP/following{/other_user}","gists_url":"https://api.github.com/users/UncP/gists{/gist_id}","starred_url":"https://api.github.com/users/UncP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UncP/subscriptions","organizations_url":"https://api.github.com/users/UncP/orgs","repos_url":"https://api.github.com/users/UncP/repos","events_url":"https://api.github.com/users/UncP/events{/privacy}","received_events_url":"https://api.github.com/users/UncP/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/UncP/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":true,"url":"https://api.github.com/repos/UncP/tikv","forks_url":"https://api.github.com/repos/UncP/tikv/forks","keys_url":"https://api.github.com/repos/UncP/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UncP/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UncP/tikv/teams","hooks_url":"https://api.github.com/repos/UncP/tikv/hooks","issue_events_url":"https://api.github.com/repos/UncP/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/UncP/tikv/events","assignees_url":"https://api.github.com/repos/UncP/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/UncP/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/UncP/tikv/tags","blobs_url":"https://api.github.com/repos/UncP/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UncP/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UncP/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/UncP/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UncP/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/UncP/tikv/languages","stargazers_url":"https://api.github.com/repos/UncP/tikv/stargazers","contributors_url":"https://api.github.com/repos/UncP/tikv/contributors","subscribers_url":"https://api.github.com/repos/UncP/tikv/subscribers","subscription_url":"https://api.github.com/repos/UncP/tikv/subscription","commits_url":"https://api.github.com/repos/UncP/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/UncP/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/UncP/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/UncP/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/UncP/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/UncP/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UncP/tikv/merges","archive_url":"https://api.github.com/repos/UncP/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UncP/tikv/downloads","issues_url":"https://api.github.com/repos/UncP/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/UncP/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/UncP/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/UncP/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UncP/tikv/labels{/name}","releases_url":"https://api.github.com/repos/UncP/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/UncP/tikv/deployments","created_at":"2017-11-27T02:17:29Z","updated_at":"2018-03-20T01:34:21Z","pushed_at":"2018-03-20T08:28:26Z","git_url":"git://github.com/UncP/tikv.git","ssh_url":"git@github.com:UncP/tikv.git","clone_url":"https://github.com/UncP/tikv.git","svn_url":"https://github.com/UncP/tikv","homepage":"https://pingcap.com","size":13347,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"8dcc5ab06930f0c5ad8dd078a5118c03412b352d","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"name":"tikv","full_name":"pingcap/tikv","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":false,"url":"https://api.github.com/repos/pingcap/tikv","forks_url":"https://api.github.com/repos/pingcap/tikv/forks","keys_url":"https://api.github.com/repos/pingcap/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tikv/teams","hooks_url":"https://api.github.com/repos/pingcap/tikv/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tikv/events","assignees_url":"https://api.github.com/repos/pingcap/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tikv/tags","blobs_url":"https://api.github.com/repos/pingcap/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tikv/languages","stargazers_url":"https://api.github.com/repos/pingcap/tikv/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tikv/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tikv/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tikv/subscription","commits_url":"https://api.github.com/repos/pingcap/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tikv/merges","archive_url":"https://api.github.com/repos/pingcap/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tikv/downloads","issues_url":"https://api.github.com/repos/pingcap/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tikv/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2018-03-20T07:25:09Z","pushed_at":"2018-03-20T13:06:31Z","git_url":"git://github.com/pingcap/tikv.git","ssh_url":"git@github.com:pingcap/tikv.git","clone_url":"https://github.com/pingcap/tikv.git","svn_url":"https://github.com/pingcap/tikv","homepage":"https://pingcap.com","size":12380,"stargazers_count":2846,"watchers_count":2846,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":351,"mirror_url":null,"archived":false,"open_issues_count":167,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":351,"open_issues":167,"watchers":2846,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2846"},"html":{"href":"https://github.com/pingcap/tikv/pull/2846"},"issue":{"href":"https://api.github.com/repos/pingcap/tikv/issues/2846"},"comments":{"href":"https://api.github.com/repos/pingcap/tikv/issues/2846/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2846/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/2846/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tikv/statuses/5c754e9cb687ace3a3fdcaaf292ee841c12ea01b"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"UncP"}}