{"action":"created","comment":{"url":"https://api.github.com/repos/tgriesser/knex/pulls/comments/80853449","pull_request_review_id":1877180,"id":80853449,"diff_hunk":"@@ -218,26 +219,18 @@ assign(Client.prototype, {\n \n   // Acquire a connection from the pool.\n   acquireConnection() {\n-    let request = null\n-    const completed = new Promise((resolver, rejecter) => {\n-      if (!this.pool) {\n-        return rejecter(new Error('Unable to acquire a connection'))\n+    if (!this.pool) {\n+      return {\n+        completed: Promise.reject(new Error('Unable to acquire a connection'))\n       }\n-      request = this.pool.acquire(function(err, connection) {\n-        if (err) return rejecter(err)\n-        debug('acquired connection from pool: %s', connection.__knexUid)\n-        resolver(connection)\n-      })\n-    })\n-    const abort = function(reason) {\n-      if (request && !request.fulfilled) {\n-        request.abort(reason)\n+    } else {\n+      return {\n+        completed: this.pool.acquire().promise.then((connection) => {\n+          debug('acquired connection from pool: %s', connection.__knexUid)\n+          return connection\n+        })","path":"src/client.js","position":64,"original_position":64,"commit_id":"16d2683c2a128cf472375a600299b23ce6ef13f5","original_commit_id":"16d2683c2a128cf472375a600299b23ce6ef13f5","user":{"login":"elhigu","id":696345,"avatar_url":"https://avatars.githubusercontent.com/u/696345?v=3","gravatar_id":"","url":"https://api.github.com/users/elhigu","html_url":"https://github.com/elhigu","followers_url":"https://api.github.com/users/elhigu/followers","following_url":"https://api.github.com/users/elhigu/following{/other_user}","gists_url":"https://api.github.com/users/elhigu/gists{/gist_id}","starred_url":"https://api.github.com/users/elhigu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elhigu/subscriptions","organizations_url":"https://api.github.com/users/elhigu/orgs","repos_url":"https://api.github.com/users/elhigu/repos","events_url":"https://api.github.com/users/elhigu/events{/privacy}","received_events_url":"https://api.github.com/users/elhigu/received_events","type":"User","site_admin":false},"body":"Why abort is not needed anymore?","created_at":"2016-09-28T07:02:52Z","updated_at":"2016-09-28T07:02:52Z","html_url":"https://github.com/tgriesser/knex/pull/1702#discussion_r80853449","pull_request_url":"https://api.github.com/repos/tgriesser/knex/pulls/1702","_links":{"self":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/comments/80853449"},"html":{"href":"https://github.com/tgriesser/knex/pull/1702#discussion_r80853449"},"pull_request":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1702"}}},"pull_request":{"url":"https://api.github.com/repos/tgriesser/knex/pulls/1702","id":87056630,"html_url":"https://github.com/tgriesser/knex/pull/1702","diff_url":"https://github.com/tgriesser/knex/pull/1702.diff","patch_url":"https://github.com/tgriesser/knex/pull/1702.patch","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/1702","number":1702,"state":"open","locked":false,"title":"Use Tarn.js as a pool instead of generic-pool. fixes #1694 #1703","user":{"login":"koskimas","id":846508,"avatar_url":"https://avatars.githubusercontent.com/u/846508?v=3","gravatar_id":"","url":"https://api.github.com/users/koskimas","html_url":"https://github.com/koskimas","followers_url":"https://api.github.com/users/koskimas/followers","following_url":"https://api.github.com/users/koskimas/following{/other_user}","gists_url":"https://api.github.com/users/koskimas/gists{/gist_id}","starred_url":"https://api.github.com/users/koskimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koskimas/subscriptions","organizations_url":"https://api.github.com/users/koskimas/orgs","repos_url":"https://api.github.com/users/koskimas/repos","events_url":"https://api.github.com/users/koskimas/events{/privacy}","received_events_url":"https://api.github.com/users/koskimas/received_events","type":"User","site_admin":false},"body":"This pull request replaces the generic-pool with Tarn.js.\r\n\r\ngeneric-pool doesn't have a built-in timeout for connection acquire nor does\r\nit have a mechanism to cancel a pending acquire. Because of this the issue\r\n#1694 is next to impossible to fix on the knex side.\r\n\r\ngeneric-pool doesn't seem to be well maintained anymore. The last commit is\r\nsix monhts old at time of writing this and there are multiple pull requests\r\nwaiting, one of which is a fix for the acquire timeout needed here.\r\n\r\nTarn.js is a subset of generic-pool with added timeouts and a comprehensive\r\ntest suite. It is designed (by me) to be used with knex and I intend to make\r\nthat its only purpose. If you choose to merge this pull request. I'm committed \r\nto maintaining and bug fixing it to serve knex as well as possible. \r\n\r\nThis pull request also fixes an issue #1703 where connections acquired for\r\ntransactions never time out, regardless of acquireConnectionTimeout","created_at":"2016-09-28T05:25:41Z","updated_at":"2016-09-28T07:25:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05d48638de5772cc5dd641268b77a439e28a2ff0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tgriesser/knex/pulls/1702/commits","review_comments_url":"https://api.github.com/repos/tgriesser/knex/pulls/1702/comments","review_comment_url":"https://api.github.com/repos/tgriesser/knex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/1702/comments","statuses_url":"https://api.github.com/repos/tgriesser/knex/statuses/16d2683c2a128cf472375a600299b23ce6ef13f5","head":{"label":"koskimas:use-tarn-as-a-resource-pool","ref":"use-tarn-as-a-resource-pool","sha":"16d2683c2a128cf472375a600299b23ce6ef13f5","user":{"login":"koskimas","id":846508,"avatar_url":"https://avatars.githubusercontent.com/u/846508?v=3","gravatar_id":"","url":"https://api.github.com/users/koskimas","html_url":"https://github.com/koskimas","followers_url":"https://api.github.com/users/koskimas/followers","following_url":"https://api.github.com/users/koskimas/following{/other_user}","gists_url":"https://api.github.com/users/koskimas/gists{/gist_id}","starred_url":"https://api.github.com/users/koskimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koskimas/subscriptions","organizations_url":"https://api.github.com/users/koskimas/orgs","repos_url":"https://api.github.com/users/koskimas/repos","events_url":"https://api.github.com/users/koskimas/events{/privacy}","received_events_url":"https://api.github.com/users/koskimas/received_events","type":"User","site_admin":false},"repo":{"id":69238688,"name":"knex","full_name":"koskimas/knex","owner":{"login":"koskimas","id":846508,"avatar_url":"https://avatars.githubusercontent.com/u/846508?v=3","gravatar_id":"","url":"https://api.github.com/users/koskimas","html_url":"https://github.com/koskimas","followers_url":"https://api.github.com/users/koskimas/followers","following_url":"https://api.github.com/users/koskimas/following{/other_user}","gists_url":"https://api.github.com/users/koskimas/gists{/gist_id}","starred_url":"https://api.github.com/users/koskimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koskimas/subscriptions","organizations_url":"https://api.github.com/users/koskimas/orgs","repos_url":"https://api.github.com/users/koskimas/repos","events_url":"https://api.github.com/users/koskimas/events{/privacy}","received_events_url":"https://api.github.com/users/koskimas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koskimas/knex","description":"A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.","fork":true,"url":"https://api.github.com/repos/koskimas/knex","forks_url":"https://api.github.com/repos/koskimas/knex/forks","keys_url":"https://api.github.com/repos/koskimas/knex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koskimas/knex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koskimas/knex/teams","hooks_url":"https://api.github.com/repos/koskimas/knex/hooks","issue_events_url":"https://api.github.com/repos/koskimas/knex/issues/events{/number}","events_url":"https://api.github.com/repos/koskimas/knex/events","assignees_url":"https://api.github.com/repos/koskimas/knex/assignees{/user}","branches_url":"https://api.github.com/repos/koskimas/knex/branches{/branch}","tags_url":"https://api.github.com/repos/koskimas/knex/tags","blobs_url":"https://api.github.com/repos/koskimas/knex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koskimas/knex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koskimas/knex/git/refs{/sha}","trees_url":"https://api.github.com/repos/koskimas/knex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koskimas/knex/statuses/{sha}","languages_url":"https://api.github.com/repos/koskimas/knex/languages","stargazers_url":"https://api.github.com/repos/koskimas/knex/stargazers","contributors_url":"https://api.github.com/repos/koskimas/knex/contributors","subscribers_url":"https://api.github.com/repos/koskimas/knex/subscribers","subscription_url":"https://api.github.com/repos/koskimas/knex/subscription","commits_url":"https://api.github.com/repos/koskimas/knex/commits{/sha}","git_commits_url":"https://api.github.com/repos/koskimas/knex/git/commits{/sha}","comments_url":"https://api.github.com/repos/koskimas/knex/comments{/number}","issue_comment_url":"https://api.github.com/repos/koskimas/knex/issues/comments{/number}","contents_url":"https://api.github.com/repos/koskimas/knex/contents/{+path}","compare_url":"https://api.github.com/repos/koskimas/knex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koskimas/knex/merges","archive_url":"https://api.github.com/repos/koskimas/knex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koskimas/knex/downloads","issues_url":"https://api.github.com/repos/koskimas/knex/issues{/number}","pulls_url":"https://api.github.com/repos/koskimas/knex/pulls{/number}","milestones_url":"https://api.github.com/repos/koskimas/knex/milestones{/number}","notifications_url":"https://api.github.com/repos/koskimas/knex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koskimas/knex/labels{/name}","releases_url":"https://api.github.com/repos/koskimas/knex/releases{/id}","deployments_url":"https://api.github.com/repos/koskimas/knex/deployments","created_at":"2016-09-26T10:20:50Z","updated_at":"2016-09-26T10:20:51Z","pushed_at":"2016-09-27T13:16:12Z","git_url":"git://github.com/koskimas/knex.git","ssh_url":"git@github.com:koskimas/knex.git","clone_url":"https://github.com/koskimas/knex.git","svn_url":"https://github.com/koskimas/knex","homepage":"knexjs.org","size":10859,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"tgriesser:master","ref":"master","sha":"9d6798583b94561f1dae41743edeacd7750d346a","user":{"login":"tgriesser","id":154748,"avatar_url":"https://avatars.githubusercontent.com/u/154748?v=3","gravatar_id":"","url":"https://api.github.com/users/tgriesser","html_url":"https://github.com/tgriesser","followers_url":"https://api.github.com/users/tgriesser/followers","following_url":"https://api.github.com/users/tgriesser/following{/other_user}","gists_url":"https://api.github.com/users/tgriesser/gists{/gist_id}","starred_url":"https://api.github.com/users/tgriesser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgriesser/subscriptions","organizations_url":"https://api.github.com/users/tgriesser/orgs","repos_url":"https://api.github.com/users/tgriesser/repos","events_url":"https://api.github.com/users/tgriesser/events{/privacy}","received_events_url":"https://api.github.com/users/tgriesser/received_events","type":"User","site_admin":false},"repo":{"id":7363211,"name":"knex","full_name":"tgriesser/knex","owner":{"login":"tgriesser","id":154748,"avatar_url":"https://avatars.githubusercontent.com/u/154748?v=3","gravatar_id":"","url":"https://api.github.com/users/tgriesser","html_url":"https://github.com/tgriesser","followers_url":"https://api.github.com/users/tgriesser/followers","following_url":"https://api.github.com/users/tgriesser/following{/other_user}","gists_url":"https://api.github.com/users/tgriesser/gists{/gist_id}","starred_url":"https://api.github.com/users/tgriesser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgriesser/subscriptions","organizations_url":"https://api.github.com/users/tgriesser/orgs","repos_url":"https://api.github.com/users/tgriesser/repos","events_url":"https://api.github.com/users/tgriesser/events{/privacy}","received_events_url":"https://api.github.com/users/tgriesser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tgriesser/knex","description":"A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.","fork":false,"url":"https://api.github.com/repos/tgriesser/knex","forks_url":"https://api.github.com/repos/tgriesser/knex/forks","keys_url":"https://api.github.com/repos/tgriesser/knex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgriesser/knex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgriesser/knex/teams","hooks_url":"https://api.github.com/repos/tgriesser/knex/hooks","issue_events_url":"https://api.github.com/repos/tgriesser/knex/issues/events{/number}","events_url":"https://api.github.com/repos/tgriesser/knex/events","assignees_url":"https://api.github.com/repos/tgriesser/knex/assignees{/user}","branches_url":"https://api.github.com/repos/tgriesser/knex/branches{/branch}","tags_url":"https://api.github.com/repos/tgriesser/knex/tags","blobs_url":"https://api.github.com/repos/tgriesser/knex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgriesser/knex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgriesser/knex/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgriesser/knex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgriesser/knex/statuses/{sha}","languages_url":"https://api.github.com/repos/tgriesser/knex/languages","stargazers_url":"https://api.github.com/repos/tgriesser/knex/stargazers","contributors_url":"https://api.github.com/repos/tgriesser/knex/contributors","subscribers_url":"https://api.github.com/repos/tgriesser/knex/subscribers","subscription_url":"https://api.github.com/repos/tgriesser/knex/subscription","commits_url":"https://api.github.com/repos/tgriesser/knex/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgriesser/knex/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgriesser/knex/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgriesser/knex/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgriesser/knex/contents/{+path}","compare_url":"https://api.github.com/repos/tgriesser/knex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgriesser/knex/merges","archive_url":"https://api.github.com/repos/tgriesser/knex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgriesser/knex/downloads","issues_url":"https://api.github.com/repos/tgriesser/knex/issues{/number}","pulls_url":"https://api.github.com/repos/tgriesser/knex/pulls{/number}","milestones_url":"https://api.github.com/repos/tgriesser/knex/milestones{/number}","notifications_url":"https://api.github.com/repos/tgriesser/knex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgriesser/knex/labels{/name}","releases_url":"https://api.github.com/repos/tgriesser/knex/releases{/id}","deployments_url":"https://api.github.com/repos/tgriesser/knex/deployments","created_at":"2012-12-29T05:18:25Z","updated_at":"2016-09-28T06:07:44Z","pushed_at":"2016-09-28T05:25:41Z","git_url":"git://github.com/tgriesser/knex.git","ssh_url":"git@github.com:tgriesser/knex.git","clone_url":"https://github.com/tgriesser/knex.git","svn_url":"https://github.com/tgriesser/knex","homepage":"knexjs.org","size":13205,"stargazers_count":3395,"watchers_count":3395,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":538,"mirror_url":null,"open_issues_count":387,"forks":538,"open_issues":387,"watchers":3395,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1702"},"html":{"href":"https://github.com/tgriesser/knex/pull/1702"},"issue":{"href":"https://api.github.com/repos/tgriesser/knex/issues/1702"},"comments":{"href":"https://api.github.com/repos/tgriesser/knex/issues/1702/comments"},"review_comments":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1702/comments"},"review_comment":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1702/commits"},"statuses":{"href":"https://api.github.com/repos/tgriesser/knex/statuses/16d2683c2a128cf472375a600299b23ce6ef13f5"}}}}
{"actor":{"display_login":"elhigu"}}