[
https://issues.apache.org/jira/browse/TINKERPOP-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17629555#comment-17629555
]
ASF GitHub Bot commented on TINKERPOP-2806:
-------------------------------------------
tkolanko commented on code in PR #1837:
URL: https://github.com/apache/tinkerpop/pull/1837#discussion_r1014906005
##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java:
##########
@@ -231,9 +233,18 @@ protected void evalOpInternal(final Context ctx, final
Supplier<GremlinExecutor>
final GremlinExecutor.LifeCycle lifeCycle =
GremlinExecutor.LifeCycle.build()
.evaluationTimeoutOverride(seto)
.afterFailure((b,t) -> {
+ graphManager.onQueryError(msg, t);
if (managedTransactionsForRequest) attemptRollback(msg,
ctx.getGraphManager(), settings.strictTransactionManagement);
})
+ .afterTimeout(b -> {
Review Comment:
@spmallette In
https://github.com/apache/tinkerpop/pull/1837/commits/718c0830d0725655b8c5999832e12f917991a9fc
I deprecated the use of `afterTimeout` as a consumer and I had the deprecated
method create a new `BiConsumer` which calls the updated `afterTimeout` method.
I also reverted the `GremlinExecutor` tests to use the deprecated method to
make sure they are still working, I can either move them to the new method or
leave things as they are
> Provide method for provider plugins to get notified on script/query
> processing
> -------------------------------------------------------------------------------
>
> Key: TINKERPOP-2806
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2806
> Project: TinkerPop
> Issue Type: Bug
> Components: server
> Affects Versions: 3.6.1
> Reporter: Tom Kolanko
> Priority: Minor
> Fix For: 3.6.2
>
>
> What happens in the gremlin-server is more or less a black box for provider
> plugins. This ticket proposes a change to the GraphManager interface to allow
> providers to opt into receiving notifications for GremlinExecutor lifecycles.
> The following items could be added to the GraphManager interface:
> /**
> * This method will be called before a script or query is processed by the
> * gremlin-server.
> * The msg is the {@link RequestMessage} received by the gremlin-server.
> */
> default void beforeQueryStart(RequestMessage msg) {
> }
> /**
> * This method will be called before a script or query is processed by the
> * gremlin-server.
> * The msg is the {@link RequestMessage} received by the gremlin-server.
> * The error is the exception encounted during processing from the
> gremlin-server.
> */
> default void onQueryError(RequestMessage msg, Throwable error) {
> }
> /**
> * When a script or query successfully completes this method will be
> called.
> * The msg is the {@link RequestMessage} received by the gremlin-server.
> */
> default void onQuerySuccess(RequestMessage msg) {
> }
> In AbstractEvalOpProcessor where the GremlinExector.LifeCycle is created the
> graphManager can be accessed through the Context and those methods called at
> each stage of the lifecycle.
> In TraversalOpProcessor the graphManager can also be accessed through
> context. Similar methods exist to the GremlinExecutor.LifeCycle, those can
> call the graphManager methods as needed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)