alex-plekhanov commented on code in PR #13765:
URL: https://github.com/apache/ignite/pull/13765#discussion_r4415892870


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java:
##########
@@ -584,6 +587,10 @@ private void execute0(boolean skipNtf) {
                 else {
                     res = U.wrapThreadLoader(dep.classLoader(), new 
Callable<Object>() {
                         @Nullable @Override public Object call() {
+                            // The job can be executed by a thread that 
already holds explicit locks.
+                            Set<GridCacheVersion> locksBefore = 
locksManager().explicitLockVersions(

Review Comment:
   Fixed



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/service/ClientServiceInvokeRequest.java:
##########
@@ -199,6 +202,34 @@ public ClientServiceInvokeRequest(BinaryReaderEx reader, 
ClientProtocolContext p
         catch (Throwable e) {
             throw new IgniteException(e);
         }
+        finally {
+            releaseLeftExplicitLocks(ctx);
+        }
+    }
+
+    /**
+     * Releases explicit locks acquired but not released by the service method 
invoked locally (a service deployed
+     * on the local node is invoked in the client connector thread). Locks are 
bound to the thread, so locks left
+     * unreleased would be inherited by the next request processed by the 
thread. The client connector thread can't
+     * acquire explicit locks outside of service invocations, so all locks 
held by the thread are released.
+     *
+     * @param ctx Connection context.
+     */
+    private void releaseLeftExplicitLocks(ClientConnectionContext ctx) {
+        try {
+            Collection<GridCacheVersion> released = 
ctx.kernalContext().cache().context().mvcc()

Review Comment:
   Fixed



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