You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Igal Shilman (Jira)" <ji...@apache.org> on 2022/03/09 14:23:01 UTC

[jira] [Commented] (FLINK-26537) Allow disabling StatefulFunctionsConfigValidator validation for classloader.parent-first-patterns.additional

    [ https://issues.apache.org/jira/browse/FLINK-26537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503610#comment-17503610 ] 

Igal Shilman commented on FLINK-26537:
--------------------------------------

Hello [~Fil Karnicki], 

How about we make a parameter that basically says that this is an embedded run, and we disable the whatever validations that make sense?

> Allow disabling StatefulFunctionsConfigValidator validation for classloader.parent-first-patterns.additional
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-26537
>                 URL: https://issues.apache.org/jira/browse/FLINK-26537
>             Project: Flink
>          Issue Type: Improvement
>          Components: Stateful Functions
>            Reporter: Fil Karnicki
>            Priority: Major
>
> For some deployments of stateful functions onto existing, shared clusters, it is impossible to tailor which classes exist on the classpath. An example would be a Cloudera Flink cluster, which adds protobuf-java classes that clash with statefun ones.
> Stateful functions require the following flink-config.yaml setting:
> {{classloader.parent-first-patterns.additional: org.apache.flink.statefun;org.apache.kafka;{+}*com.google.protobuf*{+}}} 
> In the case of the cloudera flink cluster, this will cause old, 2.5.0 protobuf classes to be loaded by statefun, which causes MethodNotFound exceptions. 
> The idea is to allow disabling of the validation below, if some config setting is present in the global flink configuration, for example: statefun.validation.parent-first-classloader.disable=true
>  
> {code:java}
> private static void validateParentFirstClassloaderPatterns(Configuration configuration) {
>   final Set<String> parentFirstClassloaderPatterns =
>       parentFirstClassloaderPatterns(configuration);
>   if (!parentFirstClassloaderPatterns.containsAll(PARENT_FIRST_CLASSLOADER_PATTERNS)) {
>     throw new StatefulFunctionsInvalidConfigException(
>         CoreOptions.ALWAYS_PARENT_FIRST_LOADER_PATTERNS_ADDITIONAL,
>         "Must contain all of " + String.join(", ", PARENT_FIRST_CLASSLOADER_PATTERNS));
>   }
> } {code}
>  
> Then, we wouldn't need to contain com.google.protobuf in {{classloader.parent-first-patterns.additional:}} and it would be up to the statefun user to use protobuf classes which are compatible with their version of statefun.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)