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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]