You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/01/21 01:42:44 UTC
[GitHub] [pulsar] wangjialing218 commented on a change in pull request #13205: [PIP 86][Function] add funtion api to support preload and release external resources
wangjialing218 commented on a change in pull request #13205:
URL: https://github.com/apache/pulsar/pull/13205#discussion_r789278265
##########
File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
##########
@@ -229,7 +229,9 @@ synchronized private void setup() throws Exception {
setupLogHandler();
javaInstance = new JavaInstance(contextImpl, object, instanceConfig);
-
+ Thread.currentThread().setContextClassLoader(functionClassLoader);
+ javaInstance.setup();
+ Thread.currentThread().setContextClassLoader(instanceClassLoader);
Review comment:
Sorry I did not catch this.
If exception happened in user's setup() code, `JavaInstanceRunnable.run()` will catch the exception and close function instance. Why we need to do this in a finally 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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org