{"action":"created","comment":{"url":"https://api.github.com/repos/eleme/thrift_connector/pulls/comments/62415936","id":62415936,"diff_hunk":"@@ -60,10 +61,18 @@ def close(self):\n             self.pool.signal_handler(SIGNAL_CLOSE_NAME, self)\n \n     def is_expired(self):\n-        return self.alive_until and datetime.datetime.now() > self.alive_until\n+        now = time.time()\n+        return (self.alive_until and now > self.alive_until and\n+                random.random() < 1 - (now - self.alive_until)/self.keepalive)","path":"thrift_connector/connection_pool.py","position":35,"original_position":35,"commit_id":"5293ba4b693e21ab06ff3d862500b49ca40c75a2","original_commit_id":"5293ba4b693e21ab06ff3d862500b49ca40c75a2","user":{"login":"Damnever","id":6223594,"avatar_url":"https://avatars.githubusercontent.com/u/6223594?v=3","gravatar_id":"","url":"https://api.github.com/users/Damnever","html_url":"https://github.com/Damnever","followers_url":"https://api.github.com/users/Damnever/followers","following_url":"https://api.github.com/users/Damnever/following{/other_user}","gists_url":"https://api.github.com/users/Damnever/gists{/gist_id}","starred_url":"https://api.github.com/users/Damnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Damnever/subscriptions","organizations_url":"https://api.github.com/users/Damnever/orgs","repos_url":"https://api.github.com/users/Damnever/repos","events_url":"https://api.github.com/users/Damnever/events{/privacy}","received_events_url":"https://api.github.com/users/Damnever/received_events","type":"User","site_admin":false},"body":"好..","created_at":"2016-05-07T12:36:03Z","updated_at":"2016-05-07T12:36:03Z","html_url":"https://github.com/eleme/thrift_connector/pull/21#discussion_r62415936","pull_request_url":"https://api.github.com/repos/eleme/thrift_connector/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/comments/62415936"},"html":{"href":"https://github.com/eleme/thrift_connector/pull/21#discussion_r62415936"},"pull_request":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/eleme/thrift_connector/pulls/21","id":68330642,"html_url":"https://github.com/eleme/thrift_connector/pull/21","diff_url":"https://github.com/eleme/thrift_connector/pull/21.diff","patch_url":"https://github.com/eleme/thrift_connector/pull/21.patch","issue_url":"https://api.github.com/repos/eleme/thrift_connector/issues/21","number":21,"state":"closed","locked":false,"title":"add option to limit use of clients","user":{"login":"Damnever","id":6223594,"avatar_url":"https://avatars.githubusercontent.com/u/6223594?v=3","gravatar_id":"","url":"https://api.github.com/users/Damnever","html_url":"https://github.com/Damnever","followers_url":"https://api.github.com/users/Damnever/followers","following_url":"https://api.github.com/users/Damnever/following{/other_user}","gists_url":"https://api.github.com/users/Damnever/gists{/gist_id}","starred_url":"https://api.github.com/users/Damnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Damnever/subscriptions","organizations_url":"https://api.github.com/users/Damnever/orgs","repos_url":"https://api.github.com/users/Damnever/repos","events_url":"https://api.github.com/users/Damnever/events{/privacy}","received_events_url":"https://api.github.com/users/Damnever/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-29T06:49:43Z","updated_at":"2016-05-07T12:36:03Z","closed_at":"2016-05-03T12:32:37Z","merged_at":"2016-05-03T12:32:37Z","merge_commit_sha":"d92acfcd0613723e199d136a21c604ea55c515e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eleme/thrift_connector/pulls/21/commits","review_comments_url":"https://api.github.com/repos/eleme/thrift_connector/pulls/21/comments","review_comment_url":"https://api.github.com/repos/eleme/thrift_connector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eleme/thrift_connector/issues/21/comments","statuses_url":"https://api.github.com/repos/eleme/thrift_connector/statuses/5293ba4b693e21ab06ff3d862500b49ca40c75a2","head":{"label":"Damnever:exit_strategy","ref":"exit_strategy","sha":"5293ba4b693e21ab06ff3d862500b49ca40c75a2","user":{"login":"Damnever","id":6223594,"avatar_url":"https://avatars.githubusercontent.com/u/6223594?v=3","gravatar_id":"","url":"https://api.github.com/users/Damnever","html_url":"https://github.com/Damnever","followers_url":"https://api.github.com/users/Damnever/followers","following_url":"https://api.github.com/users/Damnever/following{/other_user}","gists_url":"https://api.github.com/users/Damnever/gists{/gist_id}","starred_url":"https://api.github.com/users/Damnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Damnever/subscriptions","organizations_url":"https://api.github.com/users/Damnever/orgs","repos_url":"https://api.github.com/users/Damnever/repos","events_url":"https://api.github.com/users/Damnever/events{/privacy}","received_events_url":"https://api.github.com/users/Damnever/received_events","type":"User","site_admin":false},"repo":{"id":53837094,"name":"thrift_connector","full_name":"Damnever/thrift_connector","owner":{"login":"Damnever","id":6223594,"avatar_url":"https://avatars.githubusercontent.com/u/6223594?v=3","gravatar_id":"","url":"https://api.github.com/users/Damnever","html_url":"https://github.com/Damnever","followers_url":"https://api.github.com/users/Damnever/followers","following_url":"https://api.github.com/users/Damnever/following{/other_user}","gists_url":"https://api.github.com/users/Damnever/gists{/gist_id}","starred_url":"https://api.github.com/users/Damnever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Damnever/subscriptions","organizations_url":"https://api.github.com/users/Damnever/orgs","repos_url":"https://api.github.com/users/Damnever/repos","events_url":"https://api.github.com/users/Damnever/events{/privacy}","received_events_url":"https://api.github.com/users/Damnever/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Damnever/thrift_connector","description":"Clients of thrift, utilizing connection pools","fork":true,"url":"https://api.github.com/repos/Damnever/thrift_connector","forks_url":"https://api.github.com/repos/Damnever/thrift_connector/forks","keys_url":"https://api.github.com/repos/Damnever/thrift_connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Damnever/thrift_connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Damnever/thrift_connector/teams","hooks_url":"https://api.github.com/repos/Damnever/thrift_connector/hooks","issue_events_url":"https://api.github.com/repos/Damnever/thrift_connector/issues/events{/number}","events_url":"https://api.github.com/repos/Damnever/thrift_connector/events","assignees_url":"https://api.github.com/repos/Damnever/thrift_connector/assignees{/user}","branches_url":"https://api.github.com/repos/Damnever/thrift_connector/branches{/branch}","tags_url":"https://api.github.com/repos/Damnever/thrift_connector/tags","blobs_url":"https://api.github.com/repos/Damnever/thrift_connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Damnever/thrift_connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Damnever/thrift_connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/Damnever/thrift_connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Damnever/thrift_connector/statuses/{sha}","languages_url":"https://api.github.com/repos/Damnever/thrift_connector/languages","stargazers_url":"https://api.github.com/repos/Damnever/thrift_connector/stargazers","contributors_url":"https://api.github.com/repos/Damnever/thrift_connector/contributors","subscribers_url":"https://api.github.com/repos/Damnever/thrift_connector/subscribers","subscription_url":"https://api.github.com/repos/Damnever/thrift_connector/subscription","commits_url":"https://api.github.com/repos/Damnever/thrift_connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/Damnever/thrift_connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/Damnever/thrift_connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/Damnever/thrift_connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/Damnever/thrift_connector/contents/{+path}","compare_url":"https://api.github.com/repos/Damnever/thrift_connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Damnever/thrift_connector/merges","archive_url":"https://api.github.com/repos/Damnever/thrift_connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Damnever/thrift_connector/downloads","issues_url":"https://api.github.com/repos/Damnever/thrift_connector/issues{/number}","pulls_url":"https://api.github.com/repos/Damnever/thrift_connector/pulls{/number}","milestones_url":"https://api.github.com/repos/Damnever/thrift_connector/milestones{/number}","notifications_url":"https://api.github.com/repos/Damnever/thrift_connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Damnever/thrift_connector/labels{/name}","releases_url":"https://api.github.com/repos/Damnever/thrift_connector/releases{/id}","deployments_url":"https://api.github.com/repos/Damnever/thrift_connector/deployments","created_at":"2016-03-14T07:54:16Z","updated_at":"2016-03-14T07:54:18Z","pushed_at":"2016-05-03T02:27:29Z","git_url":"git://github.com/Damnever/thrift_connector.git","ssh_url":"git@github.com:Damnever/thrift_connector.git","clone_url":"https://github.com/Damnever/thrift_connector.git","svn_url":"https://github.com/Damnever/thrift_connector","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eleme:master","ref":"master","sha":"408be384296415e77185b5304491c1083f46442c","user":{"login":"eleme","id":1201438,"avatar_url":"https://avatars.githubusercontent.com/u/1201438?v=3","gravatar_id":"","url":"https://api.github.com/users/eleme","html_url":"https://github.com/eleme","followers_url":"https://api.github.com/users/eleme/followers","following_url":"https://api.github.com/users/eleme/following{/other_user}","gists_url":"https://api.github.com/users/eleme/gists{/gist_id}","starred_url":"https://api.github.com/users/eleme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleme/subscriptions","organizations_url":"https://api.github.com/users/eleme/orgs","repos_url":"https://api.github.com/users/eleme/repos","events_url":"https://api.github.com/users/eleme/events{/privacy}","received_events_url":"https://api.github.com/users/eleme/received_events","type":"Organization","site_admin":false},"repo":{"id":25019902,"name":"thrift_connector","full_name":"eleme/thrift_connector","owner":{"login":"eleme","id":1201438,"avatar_url":"https://avatars.githubusercontent.com/u/1201438?v=3","gravatar_id":"","url":"https://api.github.com/users/eleme","html_url":"https://github.com/eleme","followers_url":"https://api.github.com/users/eleme/followers","following_url":"https://api.github.com/users/eleme/following{/other_user}","gists_url":"https://api.github.com/users/eleme/gists{/gist_id}","starred_url":"https://api.github.com/users/eleme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleme/subscriptions","organizations_url":"https://api.github.com/users/eleme/orgs","repos_url":"https://api.github.com/users/eleme/repos","events_url":"https://api.github.com/users/eleme/events{/privacy}","received_events_url":"https://api.github.com/users/eleme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eleme/thrift_connector","description":"Clients of thrift, utilizing connection pools","fork":false,"url":"https://api.github.com/repos/eleme/thrift_connector","forks_url":"https://api.github.com/repos/eleme/thrift_connector/forks","keys_url":"https://api.github.com/repos/eleme/thrift_connector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eleme/thrift_connector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eleme/thrift_connector/teams","hooks_url":"https://api.github.com/repos/eleme/thrift_connector/hooks","issue_events_url":"https://api.github.com/repos/eleme/thrift_connector/issues/events{/number}","events_url":"https://api.github.com/repos/eleme/thrift_connector/events","assignees_url":"https://api.github.com/repos/eleme/thrift_connector/assignees{/user}","branches_url":"https://api.github.com/repos/eleme/thrift_connector/branches{/branch}","tags_url":"https://api.github.com/repos/eleme/thrift_connector/tags","blobs_url":"https://api.github.com/repos/eleme/thrift_connector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eleme/thrift_connector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eleme/thrift_connector/git/refs{/sha}","trees_url":"https://api.github.com/repos/eleme/thrift_connector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eleme/thrift_connector/statuses/{sha}","languages_url":"https://api.github.com/repos/eleme/thrift_connector/languages","stargazers_url":"https://api.github.com/repos/eleme/thrift_connector/stargazers","contributors_url":"https://api.github.com/repos/eleme/thrift_connector/contributors","subscribers_url":"https://api.github.com/repos/eleme/thrift_connector/subscribers","subscription_url":"https://api.github.com/repos/eleme/thrift_connector/subscription","commits_url":"https://api.github.com/repos/eleme/thrift_connector/commits{/sha}","git_commits_url":"https://api.github.com/repos/eleme/thrift_connector/git/commits{/sha}","comments_url":"https://api.github.com/repos/eleme/thrift_connector/comments{/number}","issue_comment_url":"https://api.github.com/repos/eleme/thrift_connector/issues/comments{/number}","contents_url":"https://api.github.com/repos/eleme/thrift_connector/contents/{+path}","compare_url":"https://api.github.com/repos/eleme/thrift_connector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eleme/thrift_connector/merges","archive_url":"https://api.github.com/repos/eleme/thrift_connector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eleme/thrift_connector/downloads","issues_url":"https://api.github.com/repos/eleme/thrift_connector/issues{/number}","pulls_url":"https://api.github.com/repos/eleme/thrift_connector/pulls{/number}","milestones_url":"https://api.github.com/repos/eleme/thrift_connector/milestones{/number}","notifications_url":"https://api.github.com/repos/eleme/thrift_connector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eleme/thrift_connector/labels{/name}","releases_url":"https://api.github.com/repos/eleme/thrift_connector/releases{/id}","deployments_url":"https://api.github.com/repos/eleme/thrift_connector/deployments","created_at":"2014-10-10T04:08:13Z","updated_at":"2016-04-24T15:10:59Z","pushed_at":"2016-05-07T02:36:40Z","git_url":"git://github.com/eleme/thrift_connector.git","ssh_url":"git@github.com:eleme/thrift_connector.git","clone_url":"https://github.com/eleme/thrift_connector.git","svn_url":"https://github.com/eleme/thrift_connector","homepage":null,"size":86,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":0,"forks":20,"open_issues":0,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/21"},"html":{"href":"https://github.com/eleme/thrift_connector/pull/21"},"issue":{"href":"https://api.github.com/repos/eleme/thrift_connector/issues/21"},"comments":{"href":"https://api.github.com/repos/eleme/thrift_connector/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eleme/thrift_connector/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/eleme/thrift_connector/statuses/5293ba4b693e21ab06ff3d862500b49ca40c75a2"}}}}