Github user spmallette commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/451#discussion_r82211073
  
    --- Diff: 
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversalSideEffects.java
 ---
    @@ -54,22 +57,30 @@ public DriverRemoteTraversalSideEffects(final Client 
client, final UUID serverSi
         @Override
         public <V> V get(final String key) throws IllegalArgumentException {
             if (!sideEffects.containsKey(key)) {
    -            // specify the ARGS_HOST so that the LoadBalancingStrategy is 
subverted and the connection is forced
    -            // from the specified host (i.e. the host from the previous 
request as that host will hold the side-effects)
    -            final RequestMessage msg = 
RequestMessage.build(Tokens.OPS_GATHER)
    -                    .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect)
    -                    .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key)
    -                    .addArg(Tokens.ARGS_HOST, host)
    -                    .processor("traversal").create();
    -            try {
    -                final Result result = client.submitAsync(msg).get().one();
    -                sideEffects.put(key, null == result ? null : 
result.getObject());
    -            } catch (Exception ex) {
    -                final Throwable root = ExceptionUtils.getRootCause(ex);
    -                if (root.getMessage().equals("Could not find side-effects 
for " + serverSideEffect + "."))
    -                    sideEffects.put(key, null);
    -                else
    -                    throw new RuntimeException("Could not get keys", root);
    +            if (!closed) {
    +                // specify the ARGS_HOST so that the LoadBalancingStrategy 
is subverted and the connection is forced
    +                // from the specified host (i.e. the host from the 
previous request as that host will hold the side-effects)
    +                final RequestMessage msg = 
RequestMessage.build(Tokens.OPS_GATHER)
    +                        .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect)
    +                        .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key)
    +                        .addArg(Tokens.ARGS_HOST, host)
    +                        .processor("traversal").create();
    +                try {
    +                    final Result result = 
client.submitAsync(msg).get().one();
    +                    sideEffects.put(key, null == result ? null : 
result.getObject());
    +                    if (keys.isEmpty())
    --- End diff --
    
    Not sure if you should check `isEmpty()`.  Maybe better to check:
    
    ```java
    if (keys == Collections.emptySet())
    ```
    
    That's really when you want to new up a fresh `HashSet`, not just when its 
empty.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to