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

ASF GitHub Bot commented on METRON-1515:
----------------------------------------

Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/985#discussion_r180760561
  
    --- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/resolver/ClasspathFunctionResolver.java
 ---
    @@ -254,18 +266,24 @@ public void initialize(Context context) {
         Set<String> classes = new HashSet<>();
         Set<Class<? extends StellarFunction>> ret = new HashSet<>();
         for(ClassLoader cl : cls) {
    -      for(Class<?> c : ClassIndex.getAnnotated(Stellar.class, cl)) {
    -        LOG.debug("{}: Found class: {}", cl.getClass().getCanonicalName(), 
c.getCanonicalName());
    -        boolean isAssignable = StellarFunction.class.isAssignableFrom(c);
    -        boolean isFiltered = filterBuilder.apply(c.getCanonicalName());
    -        if( isAssignable && isFiltered ) {
    -          String className = c.getName();
    -          if(!classes.contains(className)) {
    -            LOG.debug("{}: Added class: {}", 
cl.getClass().getCanonicalName(), className);
    -            ret.add((Class<? extends StellarFunction>) c);
    -            classes.add(className);
    +      for(Class<?> c : getStellarClasses(cl)) {
    +        try {
    +          LOG.debug("{}: Found class: {}", 
cl.getClass().getCanonicalName(), c.getCanonicalName());
    +          if (includeClass(c, filterBuilder)) {
    +            String className = c.getName();
    +            if (!classes.contains(className)) {
    +              LOG.debug("{}: Added class: {}", 
cl.getClass().getCanonicalName(), className);
    +              ret.add((Class<? extends StellarFunction>) c);
    +              classes.add(className);
    +            }
               }
             }
    +        catch(Error le) {
    +          //we have had some error loading a stellar function.  This could 
mean that
    +          //the classpath is unstable (e.g. old copies of jars are on the 
classpath).
    +          LOG.error("Skipping class: " + le.getMessage()
    --- End diff --
    
    The risk of regression with commons-lang is surely much less than with 
other components is it not? But, if you are thinking that this would mean 
updating for the whole project.. then I can understand the scope issues.


> Errors loading stellar functions currently bomb the entire topology, they 
> should be recoverable
> -----------------------------------------------------------------------------------------------
>
>                 Key: METRON-1515
>                 URL: https://issues.apache.org/jira/browse/METRON-1515
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Casey Stella
>            Priority: Major
>
> If a bad stellar function gets on the classpath, the entire enrichment 
> topology (or shell) bombs.  We should just log an error and skip the function.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to