You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/16 11:27:14 UTC

[GitHub] [flink] rmetzger commented on a change in pull request #14372: [FLINK-19259][Kinesis] Remove references to allow classloader unloading

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



##########
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:
       Good idea! That works.




----------------------------------------------------------------
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:
users@infra.apache.org