{"action":"created","comment":{"url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/comments/55269137","id":55269137,"diff_hunk":"@@ -105,7 +112,24 @@ func (p *ConnPool) Acquire() (c *Conn, err error) {\n \t\tif p.logLevel >= LogLevelWarn {\n \t\t\tp.logger.Warn(\"All connections in pool are busy - waiting...\")\n \t\t}\n+\n+\t\tdeadlineReached := false\n+\n+\t\tif p.connAllocTimeout > 0 {\n+\t\t\ttimer := time.NewTimer(p.connAllocTimeout)\n+\t\t\tdefer timer.Stop()\n+\n+\t\t\tselect {\n+\t\t\tcase <-timer.C:\n+\t\t\t\tdeadlineReached = true\n+\t\t\t\tp.cond.Signal()\n+\t\t\t}","path":"conn_pool.go","position":51,"original_position":51,"commit_id":"418b43121b675a5ac53b53b8314af3384332f47e","original_commit_id":"418b43121b675a5ac53b53b8314af3384332f47e","user":{"login":"jim-slattery-rs","id":4665139,"avatar_url":"https://avatars.githubusercontent.com/u/4665139?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-slattery-rs","html_url":"https://github.com/jim-slattery-rs","followers_url":"https://api.github.com/users/jim-slattery-rs/followers","following_url":"https://api.github.com/users/jim-slattery-rs/following{/other_user}","gists_url":"https://api.github.com/users/jim-slattery-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-slattery-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-slattery-rs/subscriptions","organizations_url":"https://api.github.com/users/jim-slattery-rs/orgs","repos_url":"https://api.github.com/users/jim-slattery-rs/repos","events_url":"https://api.github.com/users/jim-slattery-rs/events{/privacy}","received_events_url":"https://api.github.com/users/jim-slattery-rs/received_events","type":"User","site_admin":false},"body":"When all connections are in use, is Acquire() supposed to immediately return once a connection becomes available? It looks like with this new change, the `select` will simply block until the timer has elapsed, with no chance for Acquire() to ever return before waiting the full `connAllocTimeout`.","created_at":"2016-03-07T20:46:56Z","updated_at":"2016-03-07T20:46:56Z","html_url":"https://github.com/konstantin-dzreev/pgx/pull/1#discussion_r55269137","pull_request_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/comments/55269137"},"html":{"href":"https://github.com/konstantin-dzreev/pgx/pull/1#discussion_r55269137"},"pull_request":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1","id":61636986,"html_url":"https://github.com/konstantin-dzreev/pgx/pull/1","diff_url":"https://github.com/konstantin-dzreev/pgx/pull/1.diff","patch_url":"https://github.com/konstantin-dzreev/pgx/pull/1.patch","issue_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/1","number":1,"state":"open","locked":false,"title":"Add ConnAllocTimeout and QueryExecTimeout","user":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-03T22:32:31Z","updated_at":"2016-03-07T20:46:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d04a0362642dce8cfaf1cc1c568bb4e3dddf0c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1/commits","review_comments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1/comments","review_comment_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/1/comments","statuses_url":"https://api.github.com/repos/konstantin-dzreev/pgx/statuses/418b43121b675a5ac53b53b8314af3384332f47e","head":{"label":"konstantin-dzreev:Add_ConnAllocTimeout_and_QueryExecTimeout","ref":"Add_ConnAllocTimeout_and_QueryExecTimeout","sha":"418b43121b675a5ac53b53b8314af3384332f47e","user":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"repo":{"id":53006162,"name":"pgx","full_name":"konstantin-dzreev/pgx","owner":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/konstantin-dzreev/pgx","description":"PostgreSQL client library for Go","fork":true,"url":"https://api.github.com/repos/konstantin-dzreev/pgx","forks_url":"https://api.github.com/repos/konstantin-dzreev/pgx/forks","keys_url":"https://api.github.com/repos/konstantin-dzreev/pgx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/konstantin-dzreev/pgx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/konstantin-dzreev/pgx/teams","hooks_url":"https://api.github.com/repos/konstantin-dzreev/pgx/hooks","issue_events_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/events{/number}","events_url":"https://api.github.com/repos/konstantin-dzreev/pgx/events","assignees_url":"https://api.github.com/repos/konstantin-dzreev/pgx/assignees{/user}","branches_url":"https://api.github.com/repos/konstantin-dzreev/pgx/branches{/branch}","tags_url":"https://api.github.com/repos/konstantin-dzreev/pgx/tags","blobs_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/refs{/sha}","trees_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/konstantin-dzreev/pgx/statuses/{sha}","languages_url":"https://api.github.com/repos/konstantin-dzreev/pgx/languages","stargazers_url":"https://api.github.com/repos/konstantin-dzreev/pgx/stargazers","contributors_url":"https://api.github.com/repos/konstantin-dzreev/pgx/contributors","subscribers_url":"https://api.github.com/repos/konstantin-dzreev/pgx/subscribers","subscription_url":"https://api.github.com/repos/konstantin-dzreev/pgx/subscription","commits_url":"https://api.github.com/repos/konstantin-dzreev/pgx/commits{/sha}","git_commits_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/commits{/sha}","comments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/comments{/number}","issue_comment_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/comments{/number}","contents_url":"https://api.github.com/repos/konstantin-dzreev/pgx/contents/{+path}","compare_url":"https://api.github.com/repos/konstantin-dzreev/pgx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/konstantin-dzreev/pgx/merges","archive_url":"https://api.github.com/repos/konstantin-dzreev/pgx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/konstantin-dzreev/pgx/downloads","issues_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues{/number}","pulls_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls{/number}","milestones_url":"https://api.github.com/repos/konstantin-dzreev/pgx/milestones{/number}","notifications_url":"https://api.github.com/repos/konstantin-dzreev/pgx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/konstantin-dzreev/pgx/labels{/name}","releases_url":"https://api.github.com/repos/konstantin-dzreev/pgx/releases{/id}","deployments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/deployments","created_at":"2016-03-03T00:07:39Z","updated_at":"2016-03-03T00:07:40Z","pushed_at":"2016-03-03T22:42:05Z","git_url":"git://github.com/konstantin-dzreev/pgx.git","ssh_url":"git@github.com:konstantin-dzreev/pgx.git","clone_url":"https://github.com/konstantin-dzreev/pgx.git","svn_url":"https://github.com/konstantin-dzreev/pgx","homepage":"","size":745,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"konstantin-dzreev:master","ref":"master","sha":"c6b6d7bad715f16cbb46e73356541fa4dd1f9333","user":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"repo":{"id":53006162,"name":"pgx","full_name":"konstantin-dzreev/pgx","owner":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/konstantin-dzreev/pgx","description":"PostgreSQL client library for Go","fork":true,"url":"https://api.github.com/repos/konstantin-dzreev/pgx","forks_url":"https://api.github.com/repos/konstantin-dzreev/pgx/forks","keys_url":"https://api.github.com/repos/konstantin-dzreev/pgx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/konstantin-dzreev/pgx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/konstantin-dzreev/pgx/teams","hooks_url":"https://api.github.com/repos/konstantin-dzreev/pgx/hooks","issue_events_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/events{/number}","events_url":"https://api.github.com/repos/konstantin-dzreev/pgx/events","assignees_url":"https://api.github.com/repos/konstantin-dzreev/pgx/assignees{/user}","branches_url":"https://api.github.com/repos/konstantin-dzreev/pgx/branches{/branch}","tags_url":"https://api.github.com/repos/konstantin-dzreev/pgx/tags","blobs_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/refs{/sha}","trees_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/konstantin-dzreev/pgx/statuses/{sha}","languages_url":"https://api.github.com/repos/konstantin-dzreev/pgx/languages","stargazers_url":"https://api.github.com/repos/konstantin-dzreev/pgx/stargazers","contributors_url":"https://api.github.com/repos/konstantin-dzreev/pgx/contributors","subscribers_url":"https://api.github.com/repos/konstantin-dzreev/pgx/subscribers","subscription_url":"https://api.github.com/repos/konstantin-dzreev/pgx/subscription","commits_url":"https://api.github.com/repos/konstantin-dzreev/pgx/commits{/sha}","git_commits_url":"https://api.github.com/repos/konstantin-dzreev/pgx/git/commits{/sha}","comments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/comments{/number}","issue_comment_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/comments{/number}","contents_url":"https://api.github.com/repos/konstantin-dzreev/pgx/contents/{+path}","compare_url":"https://api.github.com/repos/konstantin-dzreev/pgx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/konstantin-dzreev/pgx/merges","archive_url":"https://api.github.com/repos/konstantin-dzreev/pgx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/konstantin-dzreev/pgx/downloads","issues_url":"https://api.github.com/repos/konstantin-dzreev/pgx/issues{/number}","pulls_url":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls{/number}","milestones_url":"https://api.github.com/repos/konstantin-dzreev/pgx/milestones{/number}","notifications_url":"https://api.github.com/repos/konstantin-dzreev/pgx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/konstantin-dzreev/pgx/labels{/name}","releases_url":"https://api.github.com/repos/konstantin-dzreev/pgx/releases{/id}","deployments_url":"https://api.github.com/repos/konstantin-dzreev/pgx/deployments","created_at":"2016-03-03T00:07:39Z","updated_at":"2016-03-03T00:07:40Z","pushed_at":"2016-03-03T22:42:05Z","git_url":"git://github.com/konstantin-dzreev/pgx.git","ssh_url":"git@github.com:konstantin-dzreev/pgx.git","clone_url":"https://github.com/konstantin-dzreev/pgx.git","svn_url":"https://github.com/konstantin-dzreev/pgx","homepage":"","size":745,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1"},"html":{"href":"https://github.com/konstantin-dzreev/pgx/pull/1"},"issue":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/1"},"comments":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/konstantin-dzreev/pgx/statuses/418b43121b675a5ac53b53b8314af3384332f47e"}}}}