Etiquettes while merging PR from contributors

2017-10-31 Thread Chetan Mehrotra
Hi Team,

Given the switch to git I am now bit in dilemma on how to handle the
PR merge. With svn it was always done by applying the patch and
committing it. Keeps history fine. With Git there is choice to 'merge'
or rebase.

For external contributors it would be good if commit retains the
original author info. So I was thinking to follow approach mentioned
in [1]. In brief use

- `git merge --no-ff feature` for feature branches involving multiple commits
- `git cherry-pick feature` for simple bug fixes

Used this for SLING-7223. Note that while closing the PR gitbot adds
whole PR diff as comment to the jira

So far I liked the way history looked for any module in svn so bit
more comfortable with any approach which is closer to that

Any guidance here on approach to be taken would be helpful.

Chetan Mehrotra
PS: Do not want to initiate a never ending discussion around rebase or
merge! Just checking what approach we take for our project in general

[1] https://mislav.net/2013/02/merge-vs-rebase/


[jira] [Resolved] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread Chetan Mehrotra (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra resolved SLING-7223.

   Resolution: Fixed
 Assignee: Chetan Mehrotra
Fix Version/s: Commons Metrics RRD4J 1.0.2

> Spikes in RRD after restart
> ---
>
> Key: SLING-7223
> URL: https://issues.apache.org/jira/browse/SLING-7223
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
>Assignee: Chetan Mehrotra
>Priority: Major
> Fix For: Commons Metrics RRD4J 1.0.2
>
> Attachments: SLING-7223.patch
>
>
> Running the reporter for some time and then restarting the process shows 
> spikes in the collected data. These are caused by counter gauges that are 
> reset to zero after a restart. RRD interprets them as 32bit or 64bit integer 
> overflows and calculates incorrect values.



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


[jira] [Commented] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-7223:


Done with 
[commit|https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-commons-metrics-rrd4j.git;a=commitdiff;h=d6d22d0f6f431e2f9c2bf465833cf3831095636d]

> Spikes in RRD after restart
> ---
>
> Key: SLING-7223
> URL: https://issues.apache.org/jira/browse/SLING-7223
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
>Priority: Major
> Attachments: SLING-7223.patch
>
>
> Running the reporter for some time and then restarting the process shows 
> spikes in the collected data. These are caused by counter gauges that are 
> reset to zero after a restart. RRD interprets them as 32bit or 64bit integer 
> overflows and calculates incorrect values.



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


[jira] [Commented] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SLING-7223:
---

chetanmeh closed pull request #1: SLING-7223: Spikes in RRD after restart
URL: 
https://github.com/apache/sling-org-apache-sling-commons-metrics-rrd4j/pull/1
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/commons/metrics/rrd4j/impl/RRD4JReporter.java 
b/src/main/java/org/apache/sling/commons/metrics/rrd4j/impl/RRD4JReporter.java
index 40dbd7c..5cb9418 100644
--- 
a/src/main/java/org/apache/sling/commons/metrics/rrd4j/impl/RRD4JReporter.java
+++ 
b/src/main/java/org/apache/sling/commons/metrics/rrd4j/impl/RRD4JReporter.java
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.commons.metrics.rrd4j.impl;
 
+import com.codahale.metrics.Clock;
 import com.codahale.metrics.Counter;
 import com.codahale.metrics.Gauge;
 import com.codahale.metrics.Histogram;
@@ -62,6 +63,7 @@
 
 private final Map dictionary = new HashMap<>();
 private final RrdDb rrdDB;
+private final Clock clock;
 private long lastSampleTime;
 
 static Builder forRegistry(MetricRegistry metricRegistry) {
@@ -70,6 +72,7 @@ static Builder forRegistry(MetricRegistry metricRegistry) {
 
 static class Builder {
 private MetricRegistry metricRegistry;
+private Clock clock = Clock.defaultClock();
 private TimeUnit ratesUnit = TimeUnit.SECONDS;
 private TimeUnit durationUnit = TimeUnit.MICROSECONDS;
 private File path = new File(".");
@@ -144,6 +147,11 @@ Builder withStep(int step) {
 return this;
 }
 
+Builder withClock(Clock clock) {
+this.clock = clock;
+return this;
+}
+
 Builder convertRatesTo(TimeUnit ratesUnit) {
 this.ratesUnit = ratesUnit;
 return this;
@@ -159,7 +167,7 @@ RRD4JReporter build() throws IOException {
 return null;
 }
 return new RRD4JReporter(metricRegistry, "RRD4JReporter", 
MetricFilter.ALL, ratesUnit, durationUnit,
-dictionary, createDef());
+dictionary, createDef(), clock);
 }
 
 private String checkDataSource(String ds) throws 
IllegalArgumentException {
@@ -190,16 +198,23 @@ private RrdDef createDef() {
   TimeUnit rateUnit,
   TimeUnit durationUnit,
   Map dictionary,
-  RrdDef rrdDef) throws IOException {
+  RrdDef rrdDef,
+  Clock clock) throws IOException {
 super(registry, name, filter, rateUnit, durationUnit);
 this.dictionary.putAll(dictionary);
 this.rrdDB = createDB(rrdDef);
+this.clock = clock;
 storeDictionary(rrdDef.getPath() + PROPERTIES_SUFFIX);
+writeUnknownSample();
 }
 
 @Override
 public void close() {
 try {
+// write an unknown sample before closing the DB
+if (!rrdDB.isClosed()) {
+writeUnknownSample();
+}
 rrdDB.close();
 } catch (IOException e) {
 LOGGER.warn("Closing RRD failed", e);
@@ -213,7 +228,7 @@ public void report(SortedMap gauges,
SortedMap histograms,
SortedMap meters,
SortedMap timers) {
-long sampleTime = System.currentTimeMillis() / 1000;
+long sampleTime = clock.getTime() / 1000;
 if (sampleTime <= lastSampleTime) {
 // sample at most once a second
 return;
@@ -341,6 +356,12 @@ private void storeDictionary(String path) throws 
IOException {
 }
 }
 
+private void writeUnknownSample() throws IOException {
+long updateTime = rrdDB.getLastUpdateTime() + 1;
+rrdDB.createSample(updateTime).update();
+lastSampleTime = updateTime;
+}
+
 private static RrdDb createDB(RrdDef definition) throws IOException {
 File dbFile = new File(definition.getPath());
 if (!dbFile.getParentFile().exists()) {
diff --git 
a/src/test/java/org/apache/sling/commons/metrics/rrd4j/impl/RestartTest.java 
b/src/test/java/org/apache/sling/commons/metrics/rrd4j/impl/RestartTest.java
new file mode 100644
index 000..7dd4c88
--- /dev/null
+++ b/src/test/java/org/apache/sling/commons/metrics/rrd4j/impl/RestartTest.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the 

[jira] [Commented] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SLING-7223:
---

chetanmeh commented on issue #1: SLING-7223: Spikes in RRD after restart
URL: 
https://github.com/apache/sling-org-apache-sling-commons-metrics-rrd4j/pull/1#issuecomment-340977441
 
 
   Merged the PR via cherry pick d6d22d0f6f431e2f9c2bf465833cf3831095636d


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Spikes in RRD after restart
> ---
>
> Key: SLING-7223
> URL: https://issues.apache.org/jira/browse/SLING-7223
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
>Priority: Major
> Attachments: SLING-7223.patch
>
>
> Running the reporter for some time and then restarting the process shows 
> spikes in the collected data. These are caused by counter gauges that are 
> reset to zero after a restart. RRD interprets them as 32bit or 64bit integer 
> overflows and calculates incorrect values.



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


[jira] [Commented] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on SLING-7223:
---

mreutegg opened a new pull request #1: SLING-7223: Spikes in RRD after restart
URL: 
https://github.com/apache/sling-org-apache-sling-commons-metrics-rrd4j/pull/1
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Spikes in RRD after restart
> ---
>
> Key: SLING-7223
> URL: https://issues.apache.org/jira/browse/SLING-7223
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
> Attachments: SLING-7223.patch
>
>
> Running the reporter for some time and then restarting the process shows 
> spikes in the collected data. These are caused by counter gauges that are 
> reset to zero after a restart. RRD interprets them as 32bit or 64bit integer 
> overflows and calculates incorrect values.



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


[jira] [Resolved] (SLING-7222) Too frequent samples

2017-10-31 Thread Chetan Mehrotra (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra resolved SLING-7222.

   Resolution: Fixed
 Assignee: Chetan Mehrotra
Fix Version/s: Commons Metrics RRD4J 1.0.2

> Too frequent samples
> 
>
> Key: SLING-7222
> URL: https://issues.apache.org/jira/browse/SLING-7222
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
>Assignee: Chetan Mehrotra
>Priority: Minor
> Fix For: Commons Metrics RRD4J 1.0.2
>
> Attachments: SLING-7222.patch
>
>
> The metrics reporter sometimes logs error messages telling samples are 
> reported too frequently (more than once a second):
> {noformat}
> 29.10.2017 19:01:25.384 *ERROR* [metrics-RRD4JReporter-1-thread-1] 
> com.codahale.metrics.ScheduledReporter RuntimeException thrown from 
> RRD4JReporter#report. Exception was suppressed.
> java.lang.IllegalArgumentException: Bad sample time: 1509300085. Last update 
> time was 1509300085, at least one second step is required
> at org.rrd4j.core.RrdDb.store(RrdDb.java:517)
> at org.rrd4j.core.Sample.update(Sample.java:194)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter.report(RRD4JReporter.java:239)
> at 
> com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:162)
> at 
> com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:117)
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> {noformat}



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


[jira] [Commented] (SLING-7222) Too frequent samples

2017-10-31 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-7222:


Applied patch with 
[commit|https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-commons-metrics-rrd4j.git;a=commitdiff;h=a07550a196736d25f0593b5e5b2432db8bd39c1b]

> Too frequent samples
> 
>
> Key: SLING-7222
> URL: https://issues.apache.org/jira/browse/SLING-7222
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
>Priority: Minor
> Attachments: SLING-7222.patch
>
>
> The metrics reporter sometimes logs error messages telling samples are 
> reported too frequently (more than once a second):
> {noformat}
> 29.10.2017 19:01:25.384 *ERROR* [metrics-RRD4JReporter-1-thread-1] 
> com.codahale.metrics.ScheduledReporter RuntimeException thrown from 
> RRD4JReporter#report. Exception was suppressed.
> java.lang.IllegalArgumentException: Bad sample time: 1509300085. Last update 
> time was 1509300085, at least one second step is required
> at org.rrd4j.core.RrdDb.store(RrdDb.java:517)
> at org.rrd4j.core.Sample.update(Sample.java:194)
> at 
> org.apache.sling.commons.metrics.rrd4j.impl.RRD4JReporter.report(RRD4JReporter.java:239)
> at 
> com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:162)
> at 
> com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:117)
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> {noformat}



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


[jira] [Resolved] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus resolved SLING-7218.

   Resolution: Fixed
Fix Version/s: Security 1.1.8

Fixed in 
https://github.com/apache/sling-org-apache-sling-security/commit/1c8c11c4c6c11d2fb9da0e15e50a8889663e05e8.

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Security 1.1.4
>Reporter: Antonio Sanso
>Assignee: Konrad Windszus
> Fix For: Security 1.1.8
>
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Updated] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-7218:
---
Affects Version/s: (was: Security 1.1.6)
   Security 1.1.4

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Security 1.1.4
>Reporter: Antonio Sanso
>Assignee: Konrad Windszus
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Updated] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-7218:
---
Affects Version/s: Security 1.1.6

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: Security 1.1.4
>Reporter: Antonio Sanso
>Assignee: Konrad Windszus
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Assigned] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus reassigned SLING-7218:
--

Assignee: Konrad Windszus  (was: Antonio Sanso)

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Reporter: Antonio Sanso
>Assignee: Konrad Windszus
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Comment Edited] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

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

Konrad Windszus edited comment on SLING-7218 at 10/31/17 1:31 PM:
--

This is correct. According to DS 1.3 an array property which is not set 
defaults to null (irrespective of the configuration property fields default 
value which is only evaluated at build time). This is also described in 
https://osgi.org/bugzilla/show_bug.cgi?id=208. I would suggest to accept 
{{null}} here. Even setting the default to the empty string would not entirely 
prevent the NPE as the defaults are only relevant for the web console (i.e. for 
the metatype resource). I will come up with a patch for this.


was (Author: kwin):
This is correct. According to DS 1.3 an array property which is not set 
defaults to null (irrespective of the configuration property fields default 
value which is only evaluated at build time). This is also described in 
https://osgi.org/bugzilla/show_bug.cgi?id=208. I would suggest to accept 
{{null}} here.

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Reporter: Antonio Sanso
>Assignee: Antonio Sanso
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Commented] (SLING-7218) NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate

2017-10-31 Thread Konrad Windszus (JIRA)

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

Konrad Windszus commented on SLING-7218:


This is correct. According to DS 1.3 an array property which is not set 
defaults to null (irrespective of the configuration property fields default 
value which is only evaluated at build time). This is also described in 
https://osgi.org/bugzilla/show_bug.cgi?id=208. I would suggest to accept 
{{null}} here.

> NPE in org.apache.sling.security.impl.ContentDispositionFilter#activate
> ---
>
> Key: SLING-7218
> URL: https://issues.apache.org/jira/browse/SLING-7218
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Reporter: Antonio Sanso
>Assignee: Antonio Sanso
>
> {noformat}
> 09.10.2017 07:05:55.216 *ERROR* [FelixStartLevel] org.apache.sling.security 
> [org.apache.sling.security.impl.ContentDispositionFilter(96)] The activate 
> method has thrown an exception (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>  at java.util.Objects.requireNonNull(Objects.java:203)
>  at java.util.Arrays$ArrayList.(Arrays.java:3813)
>  at java.util.Arrays.asList(Arrays.java:3800)
> 09.10.2017 07:05:55.219 *ERROR* [FelixDispatchQueue] org.apache.sling.engine 
> FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory 
> returned null. (Component: 
> org.apache.sling.security.impl.ContentDispositionFilter (96)))
> org.osgi.framework.ServiceException: Service factory returned null. 
> (Component: org.apache.sling.security.impl.ContentDispositionFilter (96))
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:380)
>  at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
>  at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
> {noformat}



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


[jira] [Commented] (SLING-3049) Make Logback Stacktrace Packaging data support OSGi aware

2017-10-31 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on SLING-3049:
---

How about adding bundle + version only when it changes from the previous line?

{noformat}
31.10.2017 17:19:52.383 *WARN* [oak-executor-33] 
org.apache.jackrabbit.oak.jcr.session.RefreshStrategy This session has been 
idle for 2 minutes and might be out of date. Consider using a fresh session or 
explicitly refresh the session.
java.lang.Exception: The session was created here:
at 
org.apache.jackrabbit.oak.jcr.session.RefreshStrategy$LogOnce.(RefreshStrategy.java:170)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:279)
at 
org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:220)
at 
org.apache.jackrabbit.oak.jcr.session.SessionImpl.impersonate(SessionImpl.java:274)
at 
org.apache.sling.jcr.oak.server.internal.TcclWrappingJackrabbitSession.impersonate(TcclWrappingJackrabbitSession.java:84)
 [org.apache.sling.jcr.oak.server:1.1.4]
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.createServiceSession(AbstractSlingRepository2.java:201)
 [org.apache.sling.jcr.base:3.0.4]
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.createServiceSession(AbstractSlingRepository2.java:171)
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.loginService(AbstractSlingRepository2.java:381)
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderStateFactory.createProviderState(JcrProviderStateFactory.java:112)
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.authenticate(JcrResourceProvider.java:275)
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.authenticate(JcrResourceProvider.java:74)
 [org.apache.sling.jcr.resource:3.0.4]
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.authenticate(ProviderManager.java:161)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.getOrCreateProvider(ProviderManager.java:87)
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.authenticateAll(ProviderManager.java:129)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.createControl(ResourceResolverImpl.java:138)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.(ResourceResolverImpl.java:100)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.(ResourceResolverImpl.java:94)
at 
org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getResourceResolverInternal(CommonResourceResolverFactoryImpl.java:263)
at 
org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getServiceResourceResolver(CommonResourceResolverFactoryImpl.java:396)
at 
org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.getResourceTypeResourceResolver(ResourceResolverControl.java:704)
at 
org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.getParentResourceType(ResourceResolverControl.java:728)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getParentResourceType(ResourceResolverImpl.java:1216)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getParentResourceType(ResourceResolverImpl.java:1205)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.isResourceType(ResourceResolverImpl.java:1233)
at 
org.apache.sling.api.resource.AbstractResource.isResourceType(AbstractResource.java:121)
 [org.apache.sling.api:2.16.2]
at 
org.apache.sling.i18n.impl.JcrResourceBundleProvider.isDictionaryResource(JcrResourceBundleProvider.java:242)
 [org.apache.sling.i18n:2.5.8]
at 
org.apache.sling.i18n.impl.JcrResourceBundleProvider.onChange(JcrResourceBundleProvider.java:222)
at 
org.apache.sling.resourceresolver.impl.observation.BasicObservationReporter.reportChanges(BasicObservationReporter.java:211)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.jcr.resource.internal.JcrResourceListener.onEvent(JcrResourceListener.java:155)
 [org.apache.sling.jcr.resource:3.0.4]
at 
org.apache.jackrabbit.commons.observation.ListenerTracker$1.onEvent(ListenerTracker.java:190)
 [org.apache.jackrabbit.jackrabbit-jcr-commons:2.14.3]
at 
org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.contentChanged(ChangeProcessor.java:507)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher.contentChanged(FilteringDispatcher.java:53)
at 

[jira] [Commented] (SLING-3049) Make Logback Stacktrace Packaging data support OSGi aware

2017-10-31 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-3049:


So with bundle name included stacktrace looks like below

{noformat}
31.10.2017 17:19:52.383 *WARN* [oak-executor-33] 
org.apache.jackrabbit.oak.jcr.session.RefreshStrategy This session has been 
idle for 2 minutes and might be out of date. Consider using a fresh session or 
explicitly refresh the session.
java.lang.Exception: The session was created here:
at 
org.apache.jackrabbit.oak.jcr.session.RefreshStrategy$LogOnce.(RefreshStrategy.java:170)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:279)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:220)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.jackrabbit.oak.jcr.session.SessionImpl.impersonate(SessionImpl.java:274)
 [org.apache.jackrabbit.oak-jcr:1.6.4]
at 
org.apache.sling.jcr.oak.server.internal.TcclWrappingJackrabbitSession.impersonate(TcclWrappingJackrabbitSession.java:84)
 [org.apache.sling.jcr.oak.server:1.1.4]
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.createServiceSession(AbstractSlingRepository2.java:201)
 [org.apache.sling.jcr.base:3.0.4]
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.createServiceSession(AbstractSlingRepository2.java:171)
 [org.apache.sling.jcr.base:3.0.4]
at 
org.apache.sling.jcr.base.AbstractSlingRepository2.loginService(AbstractSlingRepository2.java:381)
 [org.apache.sling.jcr.base:3.0.4]
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrProviderStateFactory.createProviderState(JcrProviderStateFactory.java:112)
 [org.apache.sling.jcr.resource:3.0.4]
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.authenticate(JcrResourceProvider.java:275)
 [org.apache.sling.jcr.resource:3.0.4]
at 
org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.authenticate(JcrResourceProvider.java:74)
 [org.apache.sling.jcr.resource:3.0.4]
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.authenticate(ProviderManager.java:161)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.getOrCreateProvider(ProviderManager.java:87)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.providers.stateful.ProviderManager.authenticateAll(ProviderManager.java:129)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.createControl(ResourceResolverImpl.java:138)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.(ResourceResolverImpl.java:100)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.(ResourceResolverImpl.java:94)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getResourceResolverInternal(CommonResourceResolverFactoryImpl.java:263)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getServiceResourceResolver(CommonResourceResolverFactoryImpl.java:396)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.getResourceTypeResourceResolver(ResourceResolverControl.java:704)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.getParentResourceType(ResourceResolverControl.java:728)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getParentResourceType(ResourceResolverImpl.java:1216)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.getParentResourceType(ResourceResolverImpl.java:1205)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.isResourceType(ResourceResolverImpl.java:1233)
 [org.apache.sling.resourceresolver:1.5.30]
at 
org.apache.sling.api.resource.AbstractResource.isResourceType(AbstractResource.java:121)
 [org.apache.sling.api:2.16.2]
at 
org.apache.sling.i18n.impl.JcrResourceBundleProvider.isDictionaryResource(JcrResourceBundleProvider.java:242)
 [org.apache.sling.i18n:2.5.8]
at 
org.apache.sling.i18n.impl.JcrResourceBundleProvider.onChange(JcrResourceBundleProvider.java:222)
 [org.apache.sling.i18n:2.5.8]
at 

[jira] [Commented] (SLING-3049) Make Logback Stacktrace Packaging data support OSGi aware

2017-10-31 Thread Bertrand Delacretaz (JIRA)

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

Bertrand Delacretaz commented on SLING-3049:


Thanks for this, looks very useful!

Echoing Robert's comment on Twitter, I think it would be useful to also include 
the bundle symbolic name. It makes the log lines more verbose but such logs are 
verbose anyway, and it's useful information.

> Make Logback Stacktrace Packaging data support OSGi aware
> -
>
> Key: SLING-3049
> URL: https://issues.apache.org/jira/browse/SLING-3049
> Project: Sling
>  Issue Type: Improvement
>  Components: Commons
>Reporter: Chetan Mehrotra
>Assignee: Chetan Mehrotra
>  Labels: logback
> Attachments: SLING-3049.patch, 
> buildbot-exceptions-while-stopping-jetty.txt
>
>
> Logback provides a useful feature where it dumps the Class packaging Data 
> along with the stacktrace [1]. This provides a quick view of the location 
> from where classes in a given stacktrace are coming. Its default logic does 
> not work properly in OSGi env. Hence it would be useful to patch its logic to 
> become OSGi aware
> [1] http://logback.qos.ch/reasonsToSwitch.html#packagingData



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


[jira] [Commented] (SLING-7223) Spikes in RRD after restart

2017-10-31 Thread Marcel Reutegger (JIRA)

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

Marcel Reutegger commented on SLING-7223:
-

I didn't know Sling is on github now. Can you please take a look at SLING-7222 
first and commit the patch there if it looks OK to you? The patch here will 
require some conflict resolution, which I can do afterwards and then create a 
PR.

> Spikes in RRD after restart
> ---
>
> Key: SLING-7223
> URL: https://issues.apache.org/jira/browse/SLING-7223
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Metrics RRD4J 1.0.0
>Reporter: Marcel Reutegger
> Attachments: SLING-7223.patch
>
>
> Running the reporter for some time and then restarting the process shows 
> spikes in the collected data. These are caused by counter gauges that are 
> reset to zero after a restart. RRD interprets them as 32bit or 64bit integer 
> overflows and calculates incorrect values.



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


[jira] [Commented] (SLING-3049) Make Logback Stacktrace Packaging data support OSGi aware

2017-10-31 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-3049:


bq. Will this be automatically part of any stacktraces in log files?

Yes. We can possibly enable this feature by default also

> Make Logback Stacktrace Packaging data support OSGi aware
> -
>
> Key: SLING-3049
> URL: https://issues.apache.org/jira/browse/SLING-3049
> Project: Sling
>  Issue Type: Improvement
>  Components: Commons
>Reporter: Chetan Mehrotra
>Assignee: Chetan Mehrotra
>  Labels: logback
> Attachments: SLING-3049.patch, 
> buildbot-exceptions-while-stopping-jetty.txt
>
>
> Logback provides a useful feature where it dumps the Class packaging Data 
> along with the stacktrace [1]. This provides a quick view of the location 
> from where classes in a given stacktrace are coming. Its default logic does 
> not work properly in OSGi env. Hence it would be useful to patch its logic to 
> become OSGi aware
> [1] http://logback.qos.ch/reasonsToSwitch.html#packagingData



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