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


##########
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:
   @andrii0lomakin
   
   > that is not the point of this PR to test the correctness of authentication 
mechanics.
   
    I agree testing authentication mechanics are not in scope of this PR. It 
was not my intent to suggest that.
   
   > I will only add checking of the parameters of this callback there
   
   Agree, that is all you should have to do for this change. My initial comment 
was that I could not immediately identify the best existing test to add this 
check to.



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