zentol commented on a change in pull request #14372:
URL: https://github.com/apache/flink/pull/14372#discussion_r542666752



##########
File path: 
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisProducer.java
##########
@@ -423,4 +432,43 @@ private void flushSync() throws Exception {
                        }
                }
        }
+
+       /**
+        * Remove references created by the producer, preventing the 
classloader to unload. References were
+        * analyzed as of version 0.14.0.
+        */
+       private void runClassLoaderReleaseHook(ClassLoader classLoader) {
+               // unregister admin mbean
+               AwsSdkMetrics.unregisterMetricAdminMBean();
+
+               try {
+                       // Remove FileAgeManager
+                       Class<?> fileAgeManagerClazz = 
Class.forName("com.amazonaws.services.kinesis.producer.FileAgeManager", true, 
classLoader);

Review comment:
       We shouldn't do that, on the off-chance that the connector is loaded via 
/lib.
   
   Could we use `RuntimeContext#getUserCodeClassLoader` instead?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to