andrii0lomakin commented on code in PR #3137:
URL: https://github.com/apache/tinkerpop/pull/3137#discussion_r2159854853


##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java:
##########
@@ -233,15 +236,23 @@ protected void evalOpInternal(final Context ctx, final 
Supplier<GremlinExecutor>
 
         final GremlinExecutor.LifeCycle lifeCycle = 
GremlinExecutor.LifeCycle.build()
                 .evaluationTimeoutOverride(seto)
-                .afterFailure((b,t) -> {
+                .afterFailure((b, t) -> {
                     graphManager.onQueryError(msg, t);
-                    if (managedTransactionsForRequest) attemptRollback(msg, 
ctx.getGraphManager(), settings.strictTransactionManagement);
+                    if (managedTransactionsForRequest)
+                        attemptRollback(msg, ctx.getGraphManager(), 
settings.strictTransactionManagement);
+                    graphManager.afterQueryEnd(msg);
                 })
                 .afterTimeout((b, t) -> {
-                  graphManager.onQueryError(msg, t);
+                    graphManager.onQueryError(msg, t);
+                    graphManager.afterQueryEnd(msg);
                 })
                 .beforeEval(b -> {
-                    graphManager.beforeQueryStart(msg);
+                    AuthenticatedUser user = 
ctx.getChannelHandlerContext().channel().attr(StateKey.AUTHENTICATED_USER).get();
+                    if (null == user) {
+                        // This is expected when using the 
AllowAllAuthenticator
+                        user = AuthenticatedUser.ANONYMOUS_USER;
+                    }
+                    graphManager.beforeQueryStart(msg, user);

Review Comment:
   Do you suggest adding a test that checks that the processor redirected the 
context parameter correctly? 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to