tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmallette (GitHub) <git...@apache.org>
Subject [GitHub] [tinkerpop] spmallette opened pull request #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console
Date Tue, 02 Apr 2019 20:38:33 GMT
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.

[ Full content available at: https://github.com/apache/tinkerpop/pull/1088 ]
This message was relayed via gitbox.apache.org for dev@tinkerpop.apache.org

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message