[ 
https://issues.apache.org/jira/browse/TINKERPOP-2445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17234966#comment-17234966
 ] 

ASF GitHub Bot commented on TINKERPOP-2445:
-------------------------------------------

divijvaidya commented on a change in pull request #1360:
URL: https://github.com/apache/tinkerpop/pull/1360#discussion_r526370414



##########
File path: 
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
##########
@@ -861,12 +864,28 @@ public void shouldMarkHostDeadSinceServerIsDown() throws 
Exception {
         final Cluster cluster = TestClientFactory.open();
         try {
             assertEquals(0, cluster.availableHosts().size());
-            cluster.connect().init();
+            final Client client1 = cluster.connect().init();
             assertEquals(1, cluster.availableHosts().size());
 
             stopServer();
 
+            // We create a new client here which will fail to initialize but 
the original client still has
+            // host marked as connected. Since the second client failed during 
initialization, it has no way to
+            // test if a host is indeed unreachable because it doesn't have 
any established connections. It will not add
+            // the host to load balancer but it will also not remove it if it 
already exists there. Leave that
+            // responsibility to a client that added it. In this case, let the 
second client perform it's own mechanism
+            // to mark host as unavailable. The first client will discover 
that the host has failed either with next
+            // keepAlive message or the next request, whichever is earlier. In 
this case, we will simulate the second
+            // scenario by sending a new request on first client. The request 
would fail (since server is down) and
+            // client should mark the host unavailable.
             cluster.connect().init();
+
+            try {
+                client1.submit("1+1").all().join();

Review comment:
       Good point. Added.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Speed up client initialization
> ------------------------------
>
>                 Key: TINKERPOP-2445
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2445
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: driver
>    Affects Versions: 3.5.0, 3.4.8
>            Reporter: Divij Vaidya
>            Priority: Minor
>              Labels: breaking
>         Attachments: screenshot-1.png
>
>
> The current Java client has a lot of initialization overhead. Some of the 
> things we could do to trim the fat are:
> 1. Parallelize the connection creation inside a connection pool, i.e. make 
> [this for 
> loop|https://github.com/apache/tinkerpop/blob/3.4-dev/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java]
>  parallel. 
>  2. Do not create a bootstrap [for every 
> connection|https://github.com/apache/tinkerpop/blob/3.4-dev/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java#L111].
>  A single bootstrap could be reused.
> 3. Remove SASL Handler from the pipeline after negotiation is complete for a 
> connection.
> 4. Do not initialize SASL Handler if not required.
> As part of this task, we should profile the start-up time and identify other 
> places where we could optimize the start-up time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to