streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STREAMS-223) streams-monitoring exception when streamConfig not set
Date Mon, 17 Nov 2014 19:12:37 GMT

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

ASF GitHub Bot commented on STREAMS-223:
----------------------------------------

GitHub user robdouglas opened a pull request:

    https://github.com/apache/incubator-streams/pull/132

    STREAMS-223 | Fixing faulty if statement logic that was causing NPEs whe...

    ...n stream config objects were not explicitly set

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robdouglas/incubator-streams STREAMS-223

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-streams/pull/132.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #132
    
----
commit 2f11ad004cb199096457f1c29710498fab426566
Author: Robert Douglas <rdouglas@w2ogroup.com>
Date:   2014-11-17T19:12:12Z

    STREAMS-223 | Fixing faulty if statement logic that was causing NPEs when stream config
objects were not explicitly set

----


> streams-monitoring exception when streamConfig not set
> ------------------------------------------------------
>
>                 Key: STREAMS-223
>                 URL: https://issues.apache.org/jira/browse/STREAMS-223
>             Project: Streams
>          Issue Type: Bug
>            Reporter: Steve Blackmon
>            Priority: Minor
>
> LocalStreamBuilder supports a default execution even when streamConfig is empty/null
> StreamBuilder builder = new LocalStreamBuilder(100);
> streams-monitoring throws an exception and does not run when no config is supplied.
> 00:31:21.762 [main] ERROR o.a.s.m.tasks.BroadcastMonitorThread - Exception while trying
to set default broadcast thread wait time: {}
> java.lang.NullPointerException: null
> 	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.setWaitTime(BroadcastMonitorThread.java:144)
[classes/:na]
> 	at org.apache.streams.monitoring.tasks.BroadcastMonitorThread.<init>(BroadcastMonitorThread.java:58)
[classes/:na]
> 	at org.apache.streams.local.builders.LocalStreamBuilder.<init>(LocalStreamBuilder.java:114)
[classes/:na]
> 	at org.apache.streams.local.builders.LocalStreamBuilder.<init>(LocalStreamBuilder.java:89)
[classes/:na]
> 	at org.apache.streams.twitter.example.TwitterUserstreamConsole.main(TwitterUserstreamConsole.java:49)
[classes/:na]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_20]
> 	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:na]
> 00:31:21.773 [main] DEBUG o.a.s.l.builders.LocalStreamBuilder - Attaching shutdown handler
> The workaround is to supply a config like this:
>         Map<String, Object> streamConfig = Maps.newHashMap();
>         streamConfig.put(LocalStreamBuilder.TIMEOUT_KEY, 20 * 60 * 1000);
>         streamConfig.put("monitoring_broadcast_interval_ms", -1);
>         StreamBuilder builder = new LocalStreamBuilder(100, streamConfig);
> But that should not be necessary.  
> Establish documented defaults for this capability, ensure no exceptions occur in the
default state, and do not require explicit action by the implementation to use the default.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message