You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2019/04/02 20:38:33 UTC

[GitHub] [tinkerpop] spmallette opened a new pull request #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console

spmallette opened a new pull request #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console
URL: https://github.com/apache/tinkerpop/pull/1088
 
 
   https://issues.apache.org/jira/browse/TINKERPOP-2181
   
   Pretty self-explanatory:
   
   ```text
   gremlin> java.util.stream.IntStream.range(0, 10000).iterator()
   ==>0
   ==>1
   ==>2
   ==>3
   ==>4
   ...
   ==>348
   ==>349
   ==>350
   ==>351
   ==>352
   Execution interrupted by ctrl+c
   ==>353
   gremlin> Thread.sleep(5000)
   Execution interrupted by ctrl+c
   sleep interrupted
   Type ':help' or ':h' for help.
   Display stack trace? [yN]n
   gremlin> g = TinkerGraph.open().traversal()
   ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
   gremlin> g.addV().as('a').addE('link').to('a')
   ==>e[1][0-link->0]
   gremlin> g.V().repeat(out('link'))
   Execution interrupted by ctrl+c
   org.apache.tinkerpop.gremlin.process.traversal.util.TraversalInterruptedException
   Type ':help' or ':h' for help.
   Display stack trace? [yN]n
   gremlin> :remote connect tinkerpop.server conf/remote.yaml
   ==>Configured localhost/127.0.0.1:8182
   gremlin> :> g.addV().as('a').addE('link').to('a')
   ==>e[1][0-link->0]
   gremlin> :> g.V().repeat(out('link'))
   Execution interrupted by ctrl+c
   org.apache.tinkerpop.gremlin.jsr223.console.RemoteException
   Type ':help' or ':h' for help.
   Display stack trace? [yN]n
   gremlin> :remote console
   ==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
   gremlin> g.V().repeat(out('link'))
   Execution interrupted by ctrl+c
   org.apache.tinkerpop.gremlin.jsr223.console.RemoteException
   Type ':help' or ':h' for help.
   Display stack trace? [yN]n
   ```
   
   Right now it will only interrupt things that respect an actual interruption so while all of the above works nicely, something like `while(true){}` will not. This issue appears fixable on 3.4.x but not 3.3.x given some changes to groovysh in the 2.5.x line which is not available for 3.3.x and still on 2.4.x.  Backporting those changes and/or working around not having those changes is pretty ugly unfortunately. Still considering what to do, but I thought I'd issue the PR so folks could play with it if they like.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services