metron-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (METRON-1916) Stellar Classpath Function Resolver Should Handle ClassNotFoundException
Date Mon, 03 Dec 2018 14:30:00 GMT


ASF GitHub Bot commented on METRON-1916:

Github user nickwallen commented on the issue:
    > In my mind we don't have a current state where Stellar is running but not all the
functions in the class path are loaded. 
    The same thing would happen today if an `Exception` is thrown in any of the functions
being loaded.  If an Exception is thrown, instead of N functions ready-to-rock, we would have
N-1 functions.  This just expands that behavior to `ClassNotFoundException` which gets thrown
when there is a missing dependency..
    > Before we would have crashed starting up. Now we will run and crash get an error
    I don't see it that way.  Let's look at both scenarios.
    * If I am NOT using the REST function, then things just work as they should.  Yay!   I
don't want to worry about the missing dependency for a function that I have no knowledge about.
    * If I am using the REST function, an exception would still be thrown when the function
definition could not be found.  So the user still gets an exception when there is a problem.
    (Q) Any thoughts on alternative approaches?
    I prefer not to have to worry about classpath dependencies (like those required by the
REST function) that I am not using.  In this example, I was only trying to use the `STATS_*`
functions, but it was the REST function that blew things up for me.  It is difficult for a
user to track this down, because they have no knowledge of the REST function and its dependencies.
    (Alternative 1) An alternative approach would be to be more selective about what functions
we add to `stellar-common`.  Anything added to `stellar-common` forces a required dependency
on all Stellar users.  If the REST function had been a separate project, then a user could
choose to use or not use that projects and not be burdened by the additional dependency
    (Alternative 2) Could the `stellar.function.resolver.includes` and `stellar.function.resolver.excludes`
be enhanced to allow users to exclude functions they don't want to load?

> Stellar Classpath Function Resolver Should Handle ClassNotFoundException
> ------------------------------------------------------------------------
>                 Key: METRON-1916
>                 URL:
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Nick Allen
>            Assignee: Nick Allen
>            Priority: Major
> Stellar can be executed in an environment where not all of the dependencies are available
for each of the functions provided in Stellar Common. When this happens, the classpath resolver
blows-up even if you do not use the function that is missing dependencies.
> For example this exception is thrown when not all of the dependencies are available for
the new REST function.  I was only attempting to use STATS_INIT, not the REST function.
> {code:java}
> 2018-11-30 15:47:00 DEBUG BaseFunctionResolver:165 - Resolving Stellar function in class
> 2018-11-30 15:47:00 ERROR DefaultProfileBuilder:302 - Bad 'init' expression: error='Unable
to parse: STATS_INIT() due to: org/apache/http/conn/HttpClientConnectionManager', expr='STATS_INIT()',
profile='profile-with-stats', entity='global', variables-available='[adapter.threatinteladapter.end.ts,
bro_timestamp, ip_dst_port, enrichmentsplitterbolt.splitter.end.ts, enrichmentsplitterbolt.splitter.begin.ts,
adapter.hostfromjsonlistadapter.end.ts, adapter.geoadapter.begin.ts, uid, trans_depth, protocol,
original_string, ip_dst_addr, threatinteljoinbolt.joiner.ts, host, enrichmentjoinbolt.joiner.ts,
adapter.hostfromjsonlistadapter.begin.ts, threatintelsplitterbolt.splitter.begin.ts, ip_src_addr,
user_agent, timestamp, method, request_body_len, uri, tags, source.type, adapter.geoadapter.end.ts,
referrer, threatintelsplitterbolt.splitter.end.ts, adapter.threatinteladapter.begin.ts, ip_src_port,
guid, response_body_len]'
> org.apache.metron.stellar.dsl.ParseException: Unable to parse: STATS_INIT() due to: org/apache/http/conn/HttpClientConnectionManager
> at org.apache.metron.stellar.common.BaseStellarProcessor.createException(
> at org.apache.metron.stellar.common.BaseStellarProcessor.parse(
> at org.apache.metron.stellar.common.DefaultStellarStatefulExecutor.execute(
> at org.apache.metron.stellar.common.DefaultStellarStatefulExecutor.assign(
> at org.apache.metron.profiler.DefaultProfileBuilder.assign(
> at org.apache.metron.profiler.DefaultProfileBuilder.apply(
> at org.apache.metron.profiler.DefaultMessageDistributor.distribute(
> at org.apache.metron.profiler.storm.ProfileBuilderBolt.handleMessage(
> at org.apache.metron.profiler.storm.ProfileBuilderBolt.execute(
> at org.apache.storm.topology.WindowedBoltExecutor$1.onActivation(
> at org.apache.storm.windowing.WindowManager.onTrigger(
> at org.apache.storm.windowing.WatermarkTimeTriggerPolicy.handleWaterMarkEvent(
> at org.apache.storm.windowing.WatermarkTimeTriggerPolicy.track(
> at org.apache.storm.windowing.WindowManager.track(
> at org.apache.storm.windowing.WindowManager.add(
> at
> at java.util.concurrent.Executors$
> at java.util.concurrent.FutureTask.runAndReset(
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
> at java.util.concurrent.ScheduledThreadPoolExecutor$
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> at java.util.concurrent.ThreadPoolExecutor$
> at
> Caused by: java.lang.NoClassDefFoundError: org/apache/http/conn/HttpClientConnectionManager
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(
> at java.lang.Class.getConstructor0(
> at java.lang.Class.getConstructor(
> at org.apache.metron.stellar.dsl.functions.resolver.BaseFunctionResolver.createFunction(
> at org.apache.metron.stellar.dsl.functions.resolver.BaseFunctionResolver.resolveFunction(
> at org.apache.metron.stellar.dsl.functions.resolver.BaseFunctionResolver.resolveFunctions(
> at$MemoizingSupplier.get(
> at org.apache.metron.stellar.dsl.functions.resolver.BaseFunctionResolver.apply(
> at org.apache.metron.stellar.dsl.functions.resolver.BaseFunctionResolver.apply(
> at org.apache.metron.stellar.common.StellarCompiler.resolveFunction(
> at org.apache.metron.stellar.common.StellarCompiler.lambda$exitTransformationFunc$13(
> at org.apache.metron.stellar.common.StellarCompiler$Expression.apply(
> at org.apache.metron.stellar.common.BaseStellarProcessor.parse(
> ... 21 more{code}
> When this happens the Classpath Function Resolver should allow me to use whichever functions
can be loaded correctly.

This message was sent by Atlassian JIRA

View raw message