{"action":"created","comment":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/comments/37347820","id":37347820,"diff_hunk":"@@ -120,31 +124,33 @@ public void run() {\n \n         Executor initExecutor = manager.cluster.manager.configuration.getPoolingOptions().getInitializationExecutor();\n \n-        ListenableFuture<List<Void>> allConnectionsFuture = Futures.allAsList(connectionFutures);\n+        ListenableFuture<List<Void>> allConnectionsFuture = Futures.successfulAsList(connectionFutures);\n \n         final SettableFuture<Void> initFuture = SettableFuture.create();\n-        Futures.addCallback(allConnectionsFuture, new FutureCallback<List<Void>>() {\n+        Futures.addCallback(allConnectionsFuture, new MoreFutures.SuccessCallback<List<Void>>() {\n             @Override\n             public void onSuccess(List<Void> l) {\n+                // Some of the connections might have failed, keep only the successful ones\n+                ListIterator<Connection> it = connections.listIterator();","path":"driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java","position":62,"original_position":62,"commit_id":"2eeb3fa01e1c2bc488902732fa94c648d376c349","original_commit_id":"f974dcee23bcd918e04d1f883798cdddd87d64e5","user":{"login":"tolbertam","id":6889771,"avatar_url":"https://avatars.githubusercontent.com/u/6889771?v=3","gravatar_id":"","url":"https://api.github.com/users/tolbertam","html_url":"https://github.com/tolbertam","followers_url":"https://api.github.com/users/tolbertam/followers","following_url":"https://api.github.com/users/tolbertam/following{/other_user}","gists_url":"https://api.github.com/users/tolbertam/gists{/gist_id}","starred_url":"https://api.github.com/users/tolbertam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tolbertam/subscriptions","organizations_url":"https://api.github.com/users/tolbertam/orgs","repos_url":"https://api.github.com/users/tolbertam/repos","events_url":"https://api.github.com/users/tolbertam/events{/privacy}","received_events_url":"https://api.github.com/users/tolbertam/received_events","type":"User","site_admin":false},"body":"I've noticed that if all connections fail the host is not marked down.  This is because ConvictionPolicy does not mark host down if connection was initializing.  This leaves us with an empty set of connections in the success callback here.    It will try to bring connections up to core properly, but I think you could argue in this case the host could be marked down.  What do you think?  I can see it both ways.","created_at":"2015-08-18T20:17:28Z","updated_at":"2015-08-18T20:17:28Z","html_url":"https://github.com/datastax/java-driver/pull/420#discussion_r37347820","pull_request_url":"https://api.github.com/repos/datastax/java-driver/pulls/420","_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments/37347820"},"html":{"href":"https://github.com/datastax/java-driver/pull/420#discussion_r37347820"},"pull_request":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/420"}}},"pull_request":{"url":"https://api.github.com/repos/datastax/java-driver/pulls/420","id":41456303,"html_url":"https://github.com/datastax/java-driver/pull/420","diff_url":"https://github.com/datastax/java-driver/pull/420.diff","patch_url":"https://github.com/datastax/java-driver/pull/420.patch","issue_url":"https://api.github.com/repos/datastax/java-driver/issues/420","number":420,"state":"open","locked":false,"title":"Allow hosts to remain partially up (JAVA-544).","user":{"login":"olim7t","id":259423,"avatar_url":"https://avatars.githubusercontent.com/u/259423?v=3","gravatar_id":"","url":"https://api.github.com/users/olim7t","html_url":"https://github.com/olim7t","followers_url":"https://api.github.com/users/olim7t/followers","following_url":"https://api.github.com/users/olim7t/following{/other_user}","gists_url":"https://api.github.com/users/olim7t/gists{/gist_id}","starred_url":"https://api.github.com/users/olim7t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olim7t/subscriptions","organizations_url":"https://api.github.com/users/olim7t/orgs","repos_url":"https://api.github.com/users/olim7t/repos","events_url":"https://api.github.com/users/olim7t/events{/privacy}","received_events_url":"https://api.github.com/users/olim7t/received_events","type":"User","site_admin":false},"body":"When a connection fails, don't mark the host down immediately: keep going with the remaining connections, and periodically try to reopen the missing ones. Only mark the host down when the last connection goes down.\r\n\r\nThis expands `ConvictionPolicy` to track the number of connections per host.\r\n\r\nMissing connections are reopened by the connection pool. This means it requires activity (borrow / return), so a completely inactive pool might not recreate its connections, even stay below its core size. I think that's a reasonable tradeoff, given that a separate reconnection process à la `AbstractReconnectionHandler` would add a lot of complexity.\r\n\r\nOn a side note, I've introduced a dedicated `Host.statesLogger`, in an attempt to centralize all logs related to host states.","created_at":"2015-08-03T11:06:48Z","updated_at":"2015-08-18T20:17:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5bb709072e42ac93ff889f6664f92fa6ac73daed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/datastax/java-driver/pulls/420/commits","review_comments_url":"https://api.github.com/repos/datastax/java-driver/pulls/420/comments","review_comment_url":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datastax/java-driver/issues/420/comments","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/2eeb3fa01e1c2bc488902732fa94c648d376c349","head":{"label":"datastax:java544","ref":"java544","sha":"2eeb3fa01e1c2bc488902732fa94c648d376c349","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","created_at":"2012-11-19T18:44:41Z","updated_at":"2015-08-18T13:06:49Z","pushed_at":"2015-08-18T02:56:26Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":24339,"stargazers_count":498,"watchers_count":498,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":352,"mirror_url":null,"open_issues_count":27,"forks":352,"open_issues":27,"watchers":498,"default_branch":"2.1"}},"base":{"label":"datastax:2.0","ref":"2.0","sha":"33b472942481983df6dc73cf70710e1b0947b355","user":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"repo":{"id":6765281,"name":"java-driver","full_name":"datastax/java-driver","owner":{"login":"datastax","id":573369,"avatar_url":"https://avatars.githubusercontent.com/u/573369?v=3","gravatar_id":"","url":"https://api.github.com/users/datastax","html_url":"https://github.com/datastax","followers_url":"https://api.github.com/users/datastax/followers","following_url":"https://api.github.com/users/datastax/following{/other_user}","gists_url":"https://api.github.com/users/datastax/gists{/gist_id}","starred_url":"https://api.github.com/users/datastax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datastax/subscriptions","organizations_url":"https://api.github.com/users/datastax/orgs","repos_url":"https://api.github.com/users/datastax/repos","events_url":"https://api.github.com/users/datastax/events{/privacy}","received_events_url":"https://api.github.com/users/datastax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/datastax/java-driver","description":"DataStax Java Driver for Apache Cassandra","fork":false,"url":"https://api.github.com/repos/datastax/java-driver","forks_url":"https://api.github.com/repos/datastax/java-driver/forks","keys_url":"https://api.github.com/repos/datastax/java-driver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datastax/java-driver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datastax/java-driver/teams","hooks_url":"https://api.github.com/repos/datastax/java-driver/hooks","issue_events_url":"https://api.github.com/repos/datastax/java-driver/issues/events{/number}","events_url":"https://api.github.com/repos/datastax/java-driver/events","assignees_url":"https://api.github.com/repos/datastax/java-driver/assignees{/user}","branches_url":"https://api.github.com/repos/datastax/java-driver/branches{/branch}","tags_url":"https://api.github.com/repos/datastax/java-driver/tags","blobs_url":"https://api.github.com/repos/datastax/java-driver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datastax/java-driver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datastax/java-driver/git/refs{/sha}","trees_url":"https://api.github.com/repos/datastax/java-driver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datastax/java-driver/statuses/{sha}","languages_url":"https://api.github.com/repos/datastax/java-driver/languages","stargazers_url":"https://api.github.com/repos/datastax/java-driver/stargazers","contributors_url":"https://api.github.com/repos/datastax/java-driver/contributors","subscribers_url":"https://api.github.com/repos/datastax/java-driver/subscribers","subscription_url":"https://api.github.com/repos/datastax/java-driver/subscription","commits_url":"https://api.github.com/repos/datastax/java-driver/commits{/sha}","git_commits_url":"https://api.github.com/repos/datastax/java-driver/git/commits{/sha}","comments_url":"https://api.github.com/repos/datastax/java-driver/comments{/number}","issue_comment_url":"https://api.github.com/repos/datastax/java-driver/issues/comments{/number}","contents_url":"https://api.github.com/repos/datastax/java-driver/contents/{+path}","compare_url":"https://api.github.com/repos/datastax/java-driver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datastax/java-driver/merges","archive_url":"https://api.github.com/repos/datastax/java-driver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datastax/java-driver/downloads","issues_url":"https://api.github.com/repos/datastax/java-driver/issues{/number}","pulls_url":"https://api.github.com/repos/datastax/java-driver/pulls{/number}","milestones_url":"https://api.github.com/repos/datastax/java-driver/milestones{/number}","notifications_url":"https://api.github.com/repos/datastax/java-driver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datastax/java-driver/labels{/name}","releases_url":"https://api.github.com/repos/datastax/java-driver/releases{/id}","created_at":"2012-11-19T18:44:41Z","updated_at":"2015-08-18T13:06:49Z","pushed_at":"2015-08-18T02:56:26Z","git_url":"git://github.com/datastax/java-driver.git","ssh_url":"git@github.com:datastax/java-driver.git","clone_url":"https://github.com/datastax/java-driver.git","svn_url":"https://github.com/datastax/java-driver","homepage":null,"size":24339,"stargazers_count":498,"watchers_count":498,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":352,"mirror_url":null,"open_issues_count":27,"forks":352,"open_issues":27,"watchers":498,"default_branch":"2.1"}},"_links":{"self":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/420"},"html":{"href":"https://github.com/datastax/java-driver/pull/420"},"issue":{"href":"https://api.github.com/repos/datastax/java-driver/issues/420"},"comments":{"href":"https://api.github.com/repos/datastax/java-driver/issues/420/comments"},"review_comments":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/420/comments"},"review_comment":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datastax/java-driver/pulls/420/commits"},"statuses":{"href":"https://api.github.com/repos/datastax/java-driver/statuses/2eeb3fa01e1c2bc488902732fa94c648d376c349"}}}}