[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-24 Thread Alex Deparvu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16140014#comment-16140014
 ] 

Alex Deparvu commented on SLING-7074:
-

bq. IIUC the activate would throw an exception if I remove the path 
configuration entry. What do you think about a fallback to the default path in 
that case?
good point. I was covered for null, but not for empty strings. I've updated the 
patch to cover this as well: [^SLING-7074-v2.patch]

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
> Attachments: SLING-7074.patch, SLING-7074-v2.patch
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-24 Thread Marcel Reutegger (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16139972#comment-16139972
 ] 

Marcel Reutegger commented on SLING-7074:
-

Looks very good to me.

Regarding the path. IIUC the activate would throw an exception if I remove the 
path configuration entry. What do you think about a fallback to the default 
path in that case?

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
> Attachments: SLING-7074.patch
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-24 Thread Marcel Reutegger (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16139682#comment-16139682
 ] 

Marcel Reutegger commented on SLING-7074:
-

I agree, it would be nice if there was some validation possible with the config 
manager. My preference is fallback to default values whenever possible and 
server side validation before values are passed to RRD4J. I would probably 
still start the reporter even if some values are malformed. E.g. when there is 
a syntax error in a datasource or archive definition. We could just ignore that 
entry and log an error or warning. A check on the datasources is already 
implemented. Something similar could be done with the archive definitions.

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-23 Thread Alex Deparvu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16138618#comment-16138618
 ] 

Alex Deparvu commented on SLING-7074:
-

this seems a bit more complicated than I though. I opened a few pull requests 
on the rrd4j project hoping things will be nicer looking, but I'm not sure what 
the eta could be [0] [1]. I'll probably submit PRs also but wanted to see what 
the maintainers think first.

The lack of parameter verification on the config manager is tough to work with. 
Basically there should be no rrd store started if
* step is <=0 (I can use the default value here)
* no datasources defined (err is "No RRD datasource specified. At least one is 
needed.")
* no archives defined (err is "No RRD archive specified. At least one is 
needed.")
and all of these are IllegalArgumentExceptions coming from rrd with no way to 
pass them to the config manager except log some sort of warning in the logs 
which might not be enough.

I think I'd go with not stopping and starting any rrd store if there's any 
illegal params. [~mreutegg] thoughts?


https://github.com/rrd4j/rrd4j/issues/104
https://github.com/rrd4j/rrd4j/issues/105

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-22 Thread Alex Deparvu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16136988#comment-16136988
 ] 

Alex Deparvu commented on SLING-7074:
-

I think I've corrupted the rrd db by setting the {{step}} to {{-1}}. the UI 
does not show it, but the logs do, I cannot change the value anymore and not 
even a restart brings it back:

{noformat}
22.08.2017 17:57:20.614 *INFO* [FelixStartLevel] 
org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter Starting 
RRD4J Metrics reporter
22.08.2017 17:57:20.659 *ERROR* [FelixStartLevel] 
org.apache.sling.commons.metrics-rrd4j 
[org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3095)] The 
activate method has thrown an exception (java.lang.IllegalArgumentException: 
Invalid RRD step specified: -1)
java.lang.IllegalArgumentException: Invalid RRD step specified: -1
at org.rrd4j.core.RrdDef.(RrdDef.java:83)
at org.rrd4j.core.RrdDef.(RrdDef.java:97)
at org.rrd4j.core.RrdDef.(RrdDef.java:114)
at org.rrd4j.core.RrdDb.getRrdDef(RrdDb.java:833)
at 
org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter.createDB(RRD4JReporter.java:310)
at 
org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter.(RRD4JReporter.java:158)
at 
org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.build(RRD4JReporter.java:127)
at 
org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
{noformat}

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7074) RRD4J NPE on removing all "Data sources" from config

2017-08-22 Thread Alex Deparvu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16136963#comment-16136963
 ] 

Alex Deparvu commented on SLING-7074:
-

In general I think the {{withDatasources}} should handle error case more 
gracefully. even the illegal values should be logged and ignored, now they are 
still kept in the config screen even though the RRD4JReporter class is in a 
weird state following the failed init (not sure what that is actually).

> RRD4J NPE on removing all "Data sources" from config
> 
>
> Key: SLING-7074
> URL: https://issues.apache.org/jira/browse/SLING-7074
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Reporter: Alex Deparvu
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.0
>
>
> Opened the config manager and deleted all entries
> {noformat}
>   *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: 
> pid=org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter)] 
> org.apache.sling.commons.metrics-rrd4j 
> [org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter(3134)] 
> The activate method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter$Builder.withDatasources(RRD4JReporter.java:91)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter.activate(CodahaleMetricsReporter.java:143)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> {noformat}
> fyi [~mreutegg]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)