Caideyipi commented on code in PR #17872:
URL: https://github.com/apache/iotdb/pull/17872#discussion_r4374797166
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/udf/service/UDFClassLoaderManager.java:
##########
@@ -64,12 +66,24 @@ private UDFClassLoaderManager() throws IOException {
}
public void initializeUDFQuery(String queryId) {
- activeClassLoader.get().acquire();
- queryIdToUDFClassLoaderMap.put(queryId, activeClassLoader.get());
+ final UDFClassLoader previousClassLoader;
+ synchronized (activeClassLoaderLock) {
+ final UDFClassLoader currentClassLoader = activeClassLoader.get();
+ currentClassLoader.acquire();
+ previousClassLoader = queryIdToUDFClassLoaderMap.put(queryId,
currentClassLoader);
+ }
+ releaseClassLoader(queryId, previousClassLoader);
Review Comment:
Resolved in eea3674c2a1 by using DriverTask ID + Operator ID for each
TransformOperator resource namespace and removing the manager overwrite/release
workaround. The two new lifetime tests fail against both the base (leaked
registrations) and the previous PR head (premature closure), and both pass with
independent operator IDs. A real 1C1D run also confirmed zero retained
registrations after each of ten executions of the reproducing SQL.
--
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]