nicoloboschi commented on a change in pull request #12973:
URL: https://github.com/apache/pulsar/pull/12973#discussion_r756684661



##########
File path: 
pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java
##########
@@ -728,20 +729,28 @@ public SourceConfig getSourceInfo(final String tenant,
             }
         }
 
-        // if source is not builtin, attempt to extract classloader from 
package file if it exists
-        if (classLoader == null && sourcePackageFile != null) {
-            classLoader = 
getClassLoaderFromPackage(sourceConfig.getClassName(),
-                    sourcePackageFile, 
worker().getWorkerConfig().getNarExtractionDirectory());
-        }
+        boolean shouldCloseClassLoader = false;
+        try {
+            // if source is not builtin, attempt to extract classloader from 
package file if it exists
+            shouldCloseClassLoader = true;

Review comment:
       here the `ClassLoader` must be closed only if `classLoader` is null, 
otherwise you will close the `ClassLoader` of the `Connector` instance
   




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