oleg-vlsk commented on code in PR #12760:
URL: https://github.com/apache/ignite/pull/12760#discussion_r2836684679


##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentLocalStore.java:
##########
@@ -296,23 +299,49 @@ private GridDeployment deploy(
             try {
                 Deque<GridDeployment> cachedDeps = null;
 
-                // Find existing class loader info.
-                for (Deque<GridDeployment> deps : cache.values()) {
-                    for (GridDeployment d : deps) {
-                        if (d.classLoader() == ldr) {
-                            // Cache class and alias.
-                            fireEvt = d.addDeployedClass(cls, alias);
+                Deque<GridDeployment> depsByLdr = cacheByLdr.get(ldr);
 
-                            cachedDeps = deps;
+                if (depsByLdr != null) {
+                    GridDeployment candidate = null;
 
-                            dep = d;
+                    for (GridDeployment d : depsByLdr) {
+                        if (!d.undeployed() && d.classLoader() == ldr) {
+                            candidate = d;
 
                             break;
                         }
                     }
 
-                    if (cachedDeps != null)
-                        break;
+                    if (candidate != null) {
+                        fireEvt = candidate.addDeployedClass(cls, alias);
+
+                        cachedDeps = depsByLdr;
+
+                        dep = candidate;
+                    }
+                }
+                else {

Review Comment:
   Removed this else block.



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