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

    https://github.com/apache/incubator-tinkerpop/pull/294#discussion_r61664727
  
    --- Diff: 
gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
 ---
    @@ -104,13 +113,14 @@ public Object configure(final List<String> args) 
throws RemoteException {
             final List<String> arguments = args.subList(1, args.size());
     
             if (option.equals(TOKEN_TIMEOUT)) {
    -            final String errorMessage = "The timeout option expects a 
positive integer representing milliseconds or 'max' as an argument";
    +            final String errorMessage = "The timeout option expects a 
positive integer representing milliseconds or 'none' as an argument";
                 if (arguments.size() != 1) throw new 
RemoteException(errorMessage);
                 try {
    -                final int to = arguments.get(0).equals(TOKEN_MAX) ? 
Integer.MAX_VALUE : Integer.parseInt(arguments.get(0));
    -                if (to <= 0) throw new RemoteException(errorMessage);
    -                this.timeout = to;
    -                return "Set remote timeout to " + to + "ms";
    +                // first check for MAX timeout then NONE and finally parse 
the config to int. "max" is now "deprecated"
    +                // in the sense that it will no longer be promoted. 
support for it will be removed at a later date
    +                timeout = arguments.get(0).equals(TOKEN_MAX) ? 
Integer.MAX_VALUE :
    +                        arguments.get(0).equals(TOKEN_NONE) ? NO_TIMEOUT : 
Integer.parseInt(arguments.get(0));
    +                return timeout == NO_TIMEOUT ? "Remote timeout is disable" 
: "Set remote timeout to " + timeout + "ms";
    --- End diff --
    
    Missing the check here for `if (timeout < 0) throw new 
RemoteException(errorMessage);` so you can end up with
    ```
    gremlin> :remote config timeout -2
    ==>Set remote timeout to -2ms
    ```


---
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