Re: [DISCUSS] interrupt

2016-07-22 Thread pieter-gmail
"It's not clear to me if the problem exists in HSQLDB, the test, or tail step" This had nothing to do with the TailStep bug. That one is resolved for the most part. For the rest, where the problem is, is itself part of the problem. Thread.interrupt() has rather weak semantics having many differen

Re: [DISCUSS] interrupt

2016-07-22 Thread Robert Dale
Trying to summarize the concerns I think I'm hearing: 1. cancelling the gremlin job 2. cancelling the task in the backend database, this implies handling at minimum: a. commit state: interruptable b: rollback state: probably not interruptable 3. responding to the client, returning the thread S

Re: [DISCUSS] interrupt

2016-07-21 Thread pieter-gmail
Ok, np, its not serious, Postgres is the important one for me anyhow and it is behaving. I'll investigate how to tell Postgres to cancel the query. Just stopping the traversal is not quite good enough as every now and again we have queries on Postgres that persist even if the java thread dies. Than

Re: [DISCUSS] interrupt

2016-07-21 Thread Stephen Mallette
> For every traversal that starts it notifies the caller via the reference object about the traversal. that's the tricky bit. you'd have to have some global tracking of spawned traversals to know that and it would have to be bound to the Thread that started it I guess. That information isn't going

Re: [DISCUSS] interrupt

2016-07-21 Thread pieter-gmail
Well no, the problem is Thread.interrupted() is not reliable. Does not really matter who the caller is, GremlinServer or other. Just about every 3rd party library I can see might reset the flag meaning that the check will randomly return false or true. Something as trivial as a logger might even re

Re: [DISCUSS] interrupt

2016-07-21 Thread Stephen Mallette
thanks for all that pieter. the primary reason for traversal interruption in the first place was so that gremlin server would have a chance to kill traversals that were running too long. Without a solution to that problem, I'm not sure what to do here. just tossing ideas around - could we still che

Re: [DISCUSS] interrupt

2016-07-21 Thread pieter-gmail
I just did a global Intellij search in the Sqlg project. HSQLDB has 13 catch (InterruptedException e) clauses. All of them swallows the exception and none resets the interrupt flag. Postgresql jdbc driver has 3 catch (InterruptedException e) clauses. 2 swallows the exception without resetting the

Re: [DISCUSS] interrupt

2016-07-21 Thread Stephen Mallette
I don't recall all the issues with doing traversal interruption with a flag. I suppose it could work in the same way that thread interruption works now. I will say that I'm hesitant to say that we should change this on the basis of this being a problem general to databases as we've only seen in so

[DISCUSS] interrupt

2016-07-20 Thread pieter-gmail
The current interrupt implementation is failing on Sqlg's HSQLDB implementation. The reason for this is that HSQLDB itself relies on Thread.interrupt() for its own internal logic. When TinkerPop interrupts the thread it thinks it has to do with its own logic and as a result the interrupt flag is re