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

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

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

[GitHub] [tinkerpop] dkuppitz commented on issue #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console

Posted by "dkuppitz (GitHub)" <gi...@apache.org>.
Very nice!

VOTE +1

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

[GitHub] [tinkerpop] spmallette commented on issue #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console

Posted by "spmallette (GitHub)" <gi...@apache.org>.
And here's the support for breaking infinite loops on `master`:

https://github.com/apache/tinkerpop/commit/7062595b72108e9545eaceb62e45b4ea7d946ed6

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

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

Posted by "spmallette (GitHub)" <gi...@apache.org>.
[ pull request closed by spmallette ]

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

[GitHub] [tinkerpop] robertdale commented on issue #1088: TINKERPOP-2181 Allow ctrl+c to break a command in Gremlin Console

Posted by "robertdale (GitHub)" <gi...@apache.org>.
VOTE +1

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