[GitHub] [pulsar] gmiklos-ltg commented on a diff in pull request #20115: [improve][fn] Use functions classloader in TopicSchema.newSchemaInstance() to fix ClassNotFoundException when using custom Ser

2023-05-02 Thread via GitHub


gmiklos-ltg commented on code in PR #20115:
URL: https://github.com/apache/pulsar/pull/20115#discussion_r1182197554


##
pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/TopicSchemaTest.java:
##


Review Comment:
   I have expanded upon PulsarFunctionsTest to also include an input SerDe 
class. It should fail on the current master because as it was similarly with 
#5357 it uses the wrong classloader to load the input SerDe class.



-- 
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-unsubscr...@pulsar.apache.org

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



[GitHub] [pulsar] gmiklos-ltg commented on a diff in pull request #20115: [improve][fn] Use functions classloader in TopicSchema.newSchemaInstance() to fix ClassNotFoundException when using custom Ser

2023-04-28 Thread via GitHub


gmiklos-ltg commented on code in PR #20115:
URL: https://github.com/apache/pulsar/pull/20115#discussion_r1180181144


##
pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/source/TopicSchemaTest.java:
##


Review Comment:
   I'll see what I can do.



-- 
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-unsubscr...@pulsar.apache.org

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



[GitHub] [pulsar] gmiklos-ltg commented on a diff in pull request #20115: [improve][fn] Use functions classloader in TopicSchema.newSchemaInstance() to fix ClassNotFoundException when using custom Ser

2023-04-28 Thread via GitHub


gmiklos-ltg commented on code in PR #20115:
URL: https://github.com/apache/pulsar/pull/20115#discussion_r1180180833


##
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/TopicSchema.java:
##
@@ -49,8 +53,13 @@ public class TopicSchema {
 private final Map> cachedSchemas = new HashMap<>();
 private final PulsarClient client;
 
-public TopicSchema(PulsarClient client) {
+private final ClassLoader functionsClassloader;
+
+public TopicSchema(PulsarClient client, ClassLoader functionsClassloader) {
 this.client = client;
+this.functionsClassloader = AccessController.doPrivileged(

Review Comment:
   Interestingly IntelliJ IDEA gives me a pretty strong warning that 
doPrivileged should be used while creating this URLClassLoader. Shall we omit 
this call and just create the URLClassLoader as it is? I saw other parts of 
code that made use of doPrivileged (perhaps it also makes static analysis to 
fail).



-- 
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-unsubscr...@pulsar.apache.org

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