[jira] [Created] (SLING-3582) Support OSGi DataSourceFactory for obtaining connection

2014-05-20 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3582:
--

 Summary: Support OSGi DataSourceFactory for obtaining connection
 Key: SLING-3582
 URL: https://issues.apache.org/jira/browse/SLING-3582
 Project: Sling
  Issue Type: Improvement
  Components: Extensions
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: DataSource Provider 0.0.2


DataSource provider currently obtains connection via using the Driver class 
directly. OSGi provides DataSourceFactory [1]. This factory is supposed to be 
provided by driver providers and is preferred way to creating DataSource in 
OSGi env

Pax Jdbc [2] provides DataSourceFactory impls for quite a few drivers [3] 

[1] 
http://www.osgi.org/javadoc/r4v42/org/osgi/service/jdbc/DataSourceFactory.html
[2] https://ops4j1.jira.com/wiki/display/PAXJDBC/Pax+JDBC
[3] https://ops4j1.jira.com/wiki/display/PAXJDBC/Native+Driver+Adapters



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (SLING-3574) JDBC DataSource Provider bundle

2014-05-19 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3574:
--

 Summary: JDBC DataSource Provider bundle
 Key: SLING-3574
 URL: https://issues.apache.org/jira/browse/SLING-3574
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra


This patch provides a DataSource provider bundle which configures and registers 
a DataSource services based on OSGi configuration. it uses Tomcat JDBC pool [1] 
as the backing Connection Pool

# Supports configuring the DataSource based on OSGi config wihich rich metatype
# Supports deploying of JDBC Driver as independent bundles and not as fragment
# Exposes the DataSource stats as JMX MBean

Refer to [2] for further details

[1] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
[2] https://github.com/chetanmeh/sling-datasource



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (SLING-3574) JDBC DataSource Provider bundle

2014-05-19 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3574:
---

Attachment: org.apache.sling.extensions.datasource-0.0.1-SNAPSHOT-src.zip

 JDBC DataSource Provider bundle
 ---

 Key: SLING-3574
 URL: https://issues.apache.org/jira/browse/SLING-3574
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
 Attachments: 
 org.apache.sling.extensions.datasource-0.0.1-SNAPSHOT-src.zip


 This patch provides a DataSource provider bundle which configures and 
 registers a DataSource services based on OSGi configuration. it uses Tomcat 
 JDBC pool [1] as the backing Connection Pool
 # Supports configuring the DataSource based on OSGi config wihich rich 
 metatype
 # Supports deploying of JDBC Driver as independent bundles and not as fragment
 # Exposes the DataSource stats as JMX MBean
 Refer to [2] for further details
 [1] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
 [2] https://github.com/chetanmeh/sling-datasource



--
This message was sent by Atlassian JIRA
(v6.2#6252)


JDBC DataSource Bundle (SLING-3574)

2014-05-19 Thread Chetan Mehrotra
Hi,

I have implemented a JDBC DataSource Bundle which which configures and
registers a DataSource services based on OSGi configuration. it uses
Tomcat JDBC pool [1] as the backing Connection Pool

1. Supports configuring the DataSource based on OSGi config wihich rich metatype
2. Supports deploying of JDBC4 Driver as independent bundles and not as fragment
3. Exposes the DataSource stats as JMX MBean

Refer to [2] for further details

Would it be ok to add this bundle as part of contrib (SLING-3574) [3]?

Chetan Mehrotra

[1] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
[2] https://github.com/chetanmeh/sling-datasource
[3] https://issues.apache.org/jira/browse/SLING-3574


Re: JDBC DataSource Bundle (SLING-3574)

2014-05-19 Thread Chetan Mehrotra
Hi Robert,

On Mon, May 19, 2014 at 2:30 PM, Robert Munteanu rob...@lmn.ro wrote:
 Not having looked at the code, I'm curious how this differs from pax-jdbc [4]?

Pax JDBC implements the OSGi org.osgi.service.jdbc.DataSourceFactory
[5] spec. Its primary focus is to expose DataSourceFactory for various
drivers. A user can then use the DSF api to programatically construct
the DataSource instance

The proposed bundle instead aims to declarativly create the DataSource
instance based on OSGi config. The client code just need to obtain the
DS via DI. It has following features

1. A DataSource service backed Connection Pool which can be directly
used in production
2. Enable configuring the various DataSource properties via OSGi config
3. Self contained and

This bundle can leverage the Pax Bundles to obtain Driver
instance/native DataSource instance and then wrap it with the
Connection Pool

Chetan Mehrotra
[5] 
http://www.osgi.org/javadoc/r4v42/org/osgi/service/jdbc/DataSourceFactory.html


Re: [VOTE] Release Apache Sling Classloader Leak Detector 1.0.0

2014-05-19 Thread Chetan Mehrotra
On Mon, May 19, 2014 at 7:25 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 Note that LeakDetector.java is missing the ASF header - I'll fix it in
 svn now, no need to respin the release IMO.

Thanks Bertrand!. I thought rat plugin would have failed the build for
missing header. Would take care of that in future

Chetan Mehrotra


[RESULT] [VOTE] Release Apache Sling Classloader Leak Detector 1.0.0

2014-05-19 Thread Chetan Mehrotra
The vote has passed with the following result :

+1 (binding): Justin Edelson, Carsten Ziegler, Mike Müller, Bertrand Delacretaz
+1 (non binding): Chetan Mehrotra

Can someone from the PMC could perform the final steps for the
release, as I don't have the necessary rights?

regards
Chetan


Re: [VOTE] Release Apache Sling SLF4J MDC Filter 1.0.0

2014-05-19 Thread Chetan Mehrotra
Gentle reminder!
Chetan Mehrotra


On Thu, May 15, 2014 at 3:09 PM, Chetan Mehrotra
chetan.mehro...@gmail.com wrote:
 +1 Approve the release
 Chetan Mehrotra


 On Thu, May 15, 2014 at 3:08 PM, Chetan Mehrotra
 chetan.mehro...@gmail.com wrote:
 Hi,

 This is to vote for the Apache Sling SLF4J MDC Filter 1.0.0 release.
 This is the first release of this module

 The docs are up to date at
 https://github.com/apache/sling/tree/trunk/contrib/extensions/slf4j-mdc

 Issues fixed
 https://issues.apache.org/jira/browse/SLING/fixforversion/12326853

 Release Notes
 https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12326853projectId=12310710

 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1061

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1061 /tmp/sling-staging

 Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

 This vote will be open for 72 hours.

 regards
 Chetan


[VOTE] Release Apache Sling Classloader Leak Detector 1.0.0

2014-05-16 Thread Chetan Mehrotra
Hi,

This is to vote for the Apache Sling Classloader Leak Detector 1.0.0
release. This is the first release of this module

The docs are up to date at
https://github.com/apache/sling/tree/trunk/contrib/extensions/leak-detector

Issues fixed
https://issues.apache.org/jira/browse/SLING/fixforversion/12326854

Release Notes
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12326854projectId=12310710

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1059

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1059 /tmp/sling-staging

Please vote to approve this release:

 [ ] +1 Approve the release
 [ ]  0 Don't care
 [ ] -1 Don't release, because ...

This vote will be open for 72 hours.

regards
Chetan


Re: [VOTE] Release Apache Sling Classloader Leak Detector 1.0.0

2014-05-16 Thread Chetan Mehrotra
+1 Approve the release

Chetan Mehrotra


[VOTE] Release Apache Sling SLF4J MDC Filter 1.0.0

2014-05-16 Thread Chetan Mehrotra
Hi,

This is to vote for the Apache Sling SLF4J MDC Filter 1.0.0 release.
This is the first release of this module

The docs are up to date at
https://github.com/apache/sling/tree/trunk/contrib/extensions/slf4j-mdc

Issues fixed
https://issues.apache.org/jira/browse/SLING/fixforversion/12326853

Release Notes
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12326853projectId=12310710

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1061

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1061 /tmp/sling-staging

Please vote to approve this release:

 [ ] +1 Approve the release
 [ ]  0 Don't care
 [ ] -1 Don't release, because ...

This vote will be open for 72 hours.

regards
Chetan


Re: [VOTE] Release Apache Sling SLF4J MDC Filter 1.0.0

2014-05-16 Thread Chetan Mehrotra
+1 Approve the release
Chetan Mehrotra


On Thu, May 15, 2014 at 3:08 PM, Chetan Mehrotra
chetan.mehro...@gmail.com wrote:
 Hi,

 This is to vote for the Apache Sling SLF4J MDC Filter 1.0.0 release.
 This is the first release of this module

 The docs are up to date at
 https://github.com/apache/sling/tree/trunk/contrib/extensions/slf4j-mdc

 Issues fixed
 https://issues.apache.org/jira/browse/SLING/fixforversion/12326853

 Release Notes
 https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12326853projectId=12310710

 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1061

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1061 /tmp/sling-staging

 Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

 This vote will be open for 72 hours.

 regards
 Chetan


[jira] [Updated] (SLING-3359) Classloader Leak Detector Console Tab

2014-05-16 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3359:
---

Fix Version/s: ClassLoader Leak Detector 1.0.0

 Classloader Leak Detector Console Tab
 -

 Key: SLING-3359
 URL: https://issues.apache.org/jira/browse/SLING-3359
 Project: Sling
  Issue Type: New Feature
  Components: Console
Reporter: Ian Boston
Assignee: Chetan Mehrotra
 Fix For: ClassLoader Leak Detector 1.0.0

 Attachments: 
 org.apache.sling.extensions.classloader-leak-detector-0.0.1-SNAPSHOT-src.zip


 Chetan has created a classloader leak detector console at 
 https://github.com/chetanmeh/sling-leak-detector. It would be really good to 
 get this into the contrib are and released so that consumers of Sling can use 
 it to locate code in bundles that is leaking classloaders.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: [VOTE] Move commons compiler from contrib to bundles

2014-05-15 Thread Chetan Mehrotra
On Wed, May 7, 2014 at 11:29 AM, Carsten Ziegeler cziege...@apache.org wrote:
 Therefore I think we should move this bundle from its current place in the
 contrib section to the bundles section.

Whats the general convention here. Do we have to move the bundle code
to bundles folder if a release has to be made? Cannot we release from
within contrib folder itself

Chetan Mehrotra


[jira] [Commented] (SLING-3525) Launchpad notification thread cannot access JNDI ressources on Websphere

2014-05-14 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13997472#comment-13997472
 ] 

Chetan Mehrotra commented on SLING-3525:


bq. Would it be possible to get such threads using appserver-specific 
threadpools instead of just instantiating the raw Thread object? In such cases 
we would already have the required ThreadLocals to make JNDI-lookups possible. 

The problem is that there are lots of other places where thread are created 
(Franework, Sling Scheduler etc) and it would not be possible to change all of 
them. Hence the only reliable way is to extract the required object (if its 
like singleton and does not change for every call) and publish it to OSGi 
service registry and use std OSGi constructs to access the service

 Launchpad notification thread cannot access JNDI ressources on Websphere
 

 Key: SLING-3525
 URL: https://issues.apache.org/jira/browse/SLING-3525
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
 Environment: Websphere 7 on Linux
Reporter: Jörg Hoh
 Attachments: was_258f258f_14.04.29_03.14.01.7877107172171903438789 
 copy.txt


 We have an existing JavaEnterprise-based application, which we want to move 
 into sling running on IBM Websphere appserver. In some of the resulting 
 bundles we need to access JNDI resources.
 We get this exception:
 {code}
 [29.04.14 03:14:01:790 CEST] FFDC 
 Exception:javax.naming.ConfigurationException 
 SourceId:com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS
  ProbeId:440 Reporter:java.lang.Class@5ef85ef8 
 javax.naming.ConfigurationException: A JNDI operation on a java: name 
 cannot be completed because the server runtime is not able to associate the 
 operation's thread with any J2EE application component.  This condition can 
 occur when the JNDI client using the java: name is not executed on the 
 thread of a server application request.  Make sure that a J2EE application 
 does not execute JNDI operations on java: names within static code blocks 
 or in threads created by that J2EE application.  Such code does not 
 necessarily run on the thread of a server application request and therefore 
 is not supported by JNDI operations on java: names. [Root exception is 
 javax.naming.NameNotFoundException: Name comp/env/tm not found in context 
 java:.] 
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:428)
  
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:399) 
 at 
 com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:221) 
 at 
 com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:161) 
 at javax.naming.InitialContext.lookup(InitialContext.java:436) 
 ... 
 at 
 org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:384)
  
 at 
 org.apache.sling.launchpad.webapp.SlingServlet.updated(SlingServlet.java:262) 
 at 
 org.apache.sling.launchpad.base.impl.SlingFelix$Notifier.run(SlingFelix.java:172)
  
 at java.lang.Thread.run(Thread.java:761) 
 Caused by: javax.naming.NameNotFoundException: Name comp/env/tm not found in 
 context java:. 
 at 
 com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1837) 
 at 
 com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1166) 
 at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1095) 
 at 
 com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1235) 
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:395) 
 ... 60 more
 {code}
 According to the JavaEnterprise spec, you should not create threads on your 
 own but use the mechanisms of the appserver (mostly because of the massive 
 use of threadlocals to access JDNI and stuff like that). See 
 http://stackoverflow.com/questions/533783/why-spawning-threads-in-java-ee-container-is-discouraged
  for some discussion of it.
 We would like the Launchpad to use a native Websphere thread so it can 
 actually do JNDI lookups, and not to create a new thread on the fly. 
 We would like to avoid any change to the way how JNDI resources are looked up 
 in our application.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3525) Launchpad notification thread cannot access JNDI ressources on Websphere

2014-05-13 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13996135#comment-13996135
 ] 

Chetan Mehrotra commented on SLING-3525:


Looks like you are trying to access the DataSource from JNDI. Given the various 
restrictions posed by WAS around JNDI access it might be safer (and reliable) 
to publish the DataSource as a service in OSGi Service Registry and have your 
code access it from there.

The DataSource can be registered similar to the way MBeanServer is registered 
at the time of startup [1]. or such a logic can be made part of SlingBridge. An 
extension point can be provided and we can have a generic configurable 
implementation which can extract various object from JNDI and publish them to 
OSGi SR

[1] 
https://github.com/apache/sling/blob/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/Sling.java#L297

 Launchpad notification thread cannot access JNDI ressources on Websphere
 

 Key: SLING-3525
 URL: https://issues.apache.org/jira/browse/SLING-3525
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
 Environment: Websphere 7 on Linux
Reporter: Jörg Hoh
 Attachments: was_258f258f_14.04.29_03.14.01.7877107172171903438789 
 copy.txt


 We have an existing JavaEnterprise-based application, which we want to move 
 into sling running on IBM Websphere appserver. In some of the resulting 
 bundles we need to access JNDI resources.
 We get this exception:
 {code}
 [29.04.14 03:14:01:790 CEST] FFDC 
 Exception:javax.naming.ConfigurationException 
 SourceId:com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS
  ProbeId:440 Reporter:java.lang.Class@5ef85ef8 
 javax.naming.ConfigurationException: A JNDI operation on a java: name 
 cannot be completed because the server runtime is not able to associate the 
 operation's thread with any J2EE application component.  This condition can 
 occur when the JNDI client using the java: name is not executed on the 
 thread of a server application request.  Make sure that a J2EE application 
 does not execute JNDI operations on java: names within static code blocks 
 or in threads created by that J2EE application.  Such code does not 
 necessarily run on the thread of a server application request and therefore 
 is not supported by JNDI operations on java: names. [Root exception is 
 javax.naming.NameNotFoundException: Name comp/env/tm not found in context 
 java:.] 
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:428)
  
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:399) 
 at 
 com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:221) 
 at 
 com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:161) 
 at javax.naming.InitialContext.lookup(InitialContext.java:436) 
 ... 
 at 
 org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServlet.java:384)
  
 at 
 org.apache.sling.launchpad.webapp.SlingServlet.updated(SlingServlet.java:262) 
 at 
 org.apache.sling.launchpad.base.impl.SlingFelix$Notifier.run(SlingFelix.java:172)
  
 at java.lang.Thread.run(Thread.java:761) 
 Caused by: javax.naming.NameNotFoundException: Name comp/env/tm not found in 
 context java:. 
 at 
 com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1837) 
 at 
 com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1166) 
 at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1095) 
 at 
 com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1235) 
 at 
 com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:395) 
 ... 60 more
 {code}
 According to the JavaEnterprise spec, you should not create threads on your 
 own but use the mechanisms of the appserver (mostly because of the massive 
 use of threadlocals to access JDNI and stuff like that). See 
 http://stackoverflow.com/questions/533783/why-spawning-threads-in-java-ee-container-is-discouraged
  for some discussion of it.
 We would like the Launchpad to use a native Websphere thread so it can 
 actually do JNDI lookups, and not to create a new thread on the fly. 
 We would like to avoid any change to the way how JNDI resources are looked up 
 in our application.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Sling Discovery implementation on AWS S3

2014-05-12 Thread Chetan Mehrotra
If the usecase is only for Discovery it might be simpler to run Apache
Zookeeper [1]  and use Apache Curator [2] as noted in SLING-2939.
While running on AWS one can possibly use Netflix Exhibitor [3] which
manages the Zookeeper instances and backup there state in S3.

The benefit of this approach is that Zookeeper abstract out all the
complexities of leader election (which is hard!) and can also be used
in on prem installation if required

Chetan Mehrotra
[1] http://zookeeper.apache.org/
[2] http://curator.apache.org/
[3] https://github.com/Netflix/exhibitor

On Mon, May 12, 2014 at 2:54 PM, Timothée Maret
timothee.ma...@gmail.com wrote:
 Hi,

 2014-05-12 9:02 GMT+01:00 Ian Boston i...@tfd.co.uk:

 Hi,
 +1 for distribution of properties via S3, makes perfect sense. Perhaps
 abstracting behind an API so that any low latency globally distributed
 storage provider could be used.


 Yes, discussing this offline with Felix, an alternative could be to
 implement a ResourceProvider for S3.
 S3 is really low level (key-value pair) with objects being binaries +
 metadata.
 We could implement the path structure based on the prefix property in [3]
 and stick to storing binaries only so that other S3 consumers can access
 the data directly (without using a Sling API).


 Not sure about discovery. Although [0] described the AWS VM, it
 doesn't, without further validation describe if the Sling instance is
 running and available. Its perfectly possible for the VM to be in a
 running state, with no viable Sling instance running. I dont think
 that hard to achieve but it needs to be done to support the discovery
 use case.


 Exactly, ootb, the AWS API has no concept of Sling instance and we should
 implement it.
 According to [2] we could *not* leverage instance metadata since they can't
 be modified at runtime.
 Thus, we would need to have The Sling instances publish their state in S3.


 I think we are talking about instances running on independent
 repositories here, since if all instances share the same repository
 (ie are a Jackrabbit cluster), then the repository already has a
 mechanism of communicating running instances via the repository.


 +1



 Best Regards
 Ian

 On 12 May 2014 07:06, Carsten Ziegeler cziege...@apache.org wrote:
  Hi Timotheé,
 
  yes I think this is valuable - the idea of the discovery API is to
 abstract
  the discovery and if we can benefit in certain scenarios from already
  available mechanism/information I think it makes totally sense to use
 that
  instead of adding the same on top of it.
 
  Right now, the topology is formed of clusters containing instances -
 where
  all instances in a cluster share the same repository, but instances in
  different clusters use a different one. Is this kind of topology somehow
  possible by using the AWS API? Or would all instances end up in a single
  cluster?
 
  Regards
  Carsten
 
 
  2014-05-11 18:54 GMT+02:00 Timothée Maret timothee.ma...@gmail.com:
 
  Hi,
 
  I would like to discuss a potential implementation of the Sling
 Discovery
  APIs over an eventually consistent distributed storages such as AWS S3.
  Assuming the instances being part of the topology runs in AWS, then we
  could leverage AWS APIs and service in order to implement the Discovery
  mechanism.
 
  The discovery of instances could be implemented implicitely using EC2
 REST
  API [0] without sending heartbeats, the properties for each instance
 could
  be stored in AWS S3 and distributed eventually, the leader election
 could
  be implemented with [1] or similar.
 
  The benefits (over Sling impl) would be
  * Arguably the highest availablity we can get from the environment
  * Reduced bandwith consumption (no hearthbeats)
  * Environment specific informations is implicitely distributed (local
 ip,
  external ip, hostname, region, etc.)
 
  Of course, it would bind the implementation to an environment (AWS in
 this
  case), however I believe we could apply the same mechanism to other
  eventually consistent storage.
 
  Wdyt ? Is this something that would be valuable for Sling ?
 
  Regards,
 
  Timothee
 
  [0]
 
 
 http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html
  [1] http://gsyc.es/~anto/papers/2007-dsn.pdf
 
 
 
 
  --
  Carsten Ziegeler
  cziege...@apache.org


 Regards

 Timothee

 [2]
 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
 [3] http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html


[jira] [Created] (SLING-3490) Updated embeded Logback version to 1.1.2

2014-04-04 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3490:
--

 Summary: Updated embeded Logback version to 1.1.2
 Key: SLING-3490
 URL: https://issues.apache.org/jira/browse/SLING-3490
 Project: Sling
  Issue Type: Task
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor


A new release of Logback ver 1.1.2 is available [1]. One improvement of 
interest would be [LOGBACK-268|http://jira.qos.ch/browse/LOGBACK-268] 


[1] http://logback.qos.ch/news.html 



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: [VOTE] Release Apache Sling Installer Factory Configuration 1.0.12

2014-03-24 Thread Chetan Mehrotra
+1 (non binding)
Chetan Mehrotra


On Mon, Mar 24, 2014 at 2:52 PM, Oliver Lietz apa...@oliverlietz.de wrote:
 On Sunday 23 March 2014 12:00:09 Carsten Ziegeler wrote:
 Hi,

 this vote is about the release of

 Apache Sling Installer Factory Configuration 1.0.12

 +1

 O.


[jira] [Updated] (SLING-3463) Config files cannot be installed via FileProvider on Windows

2014-03-19 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3463:
---

Description: 
Sling Installer provides support for installing OSGi config files by placing 
them in external directories. So one can place config file in sling 
home/install folder and they would be automatically installed by Sling OSGi 
Installer upon system start. Further these config are given higher priority 
over packaged config file.

This logic fails to work on Windows. For example if place config through 
org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file and 
same file is also packaged within the launchpad then only the launchpad one is 
picked up. Sling Installer tab on WebConsole shows following entries

Entry 1
-
EntityId - 
fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
 
fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.47a70bec-964a-4655-b6c4-141dc22c354b
  

ba55ef93ba200825e9cf9fa7fcff14d3/100

fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
 

INSTALLED 11:56:09:406 2014-Mar-19

Entry 2
--

EntityId  - org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService   

4e2f24f28879a116c45e7aea547909fd/55 
launchpad:resources/config/crx3tar/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config

INSTALLED 11:56:09:542 2014-Mar-19
--

As cane be seen EntityId for external file is not correct due to which it does 
not get proper pid. Hence any config created via external file route would not 
work on Windows



  was:
Sling Installer provides support for installing OSGi config files by placing 
them in external directories. So one can place config file in sling 
home/install folder and they would be automatically installed by Sling OSGi 
Installer upon system start. Further these config are given higher priority 
over packaged config file.

This logic fails to work on Windows. For example if place config through 
org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file and 
same file is also packaged within the launchpad then only the launchpad one is 
picked up. Sling Installer tab on WebConsole shows following entries

Entry 1
-
EntityId - 
fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
 
fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.47a70bec-964a-4655-b6c4-141dc22c354b
  

ba55ef93ba200825e9cf9fa7fcff14d3/100

fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
 

INSTALLED 11:56:09:406 2014-Mar-19

Entry 2
--

EntityId  - org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService   

4e2f24f28879a116c45e7aea547909fd/55 
launchpad:resources/config/crx3tar/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config

INSTALLED 11:56:09:542 2014-Mar-19
--

As cane be seen EntityId for external file is not correct due to which it does 
not get proper pid




 Config files cannot be installed via FileProvider on Windows
 

 Key: SLING-3463
 URL: https://issues.apache.org/jira/browse/SLING-3463
 Project: Sling
  Issue Type: Bug
  Components: Installer
Affects Versions: Installer Configuration Factory 1.0.10
Reporter: Chetan Mehrotra

 Sling Installer provides support for installing OSGi config files by placing 
 them in external directories. So one can place config file in sling 
 home/install folder and they would be automatically installed by Sling OSGi 
 Installer upon system start. Further these config are given higher priority 
 over packaged config file.
 This logic fails to work on Windows. For example if place config through 
 org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file 
 and same file is also packaged within the launchpad then only the launchpad 
 one is picked up. Sling Installer tab on WebConsole shows following entries
 Entry 1
 -
 EntityId - 
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService

[jira] [Updated] (SLING-3463) Config files cannot be installed via FileProvider on Windows

2014-03-19 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3463:
---

Attachment: SLING-3463.patch

This support is implemented in FileInstaller [1]

It uses the File absolutePath as InstallableResource id. Later the 
ConfigTaskCreator constructs extracts the configPid from file path. However it 
looks for '/' in path to determine configPid. This fails for Windows paths. As 
a fix it should first normalize the path to use '/' as path separator and then 
extract the configPid.

Attaching patch for the same

[1] 
https://github.com/apache/sling/blob/trunk/installer/providers/file/src/main/java/org/apache/sling/installer/provider/file/impl/Installer.java#L145

 Config files cannot be installed via FileProvider on Windows
 

 Key: SLING-3463
 URL: https://issues.apache.org/jira/browse/SLING-3463
 Project: Sling
  Issue Type: Bug
  Components: Installer
Affects Versions: Installer Configuration Factory 1.0.10
Reporter: Chetan Mehrotra
 Attachments: SLING-3463.patch


 Sling Installer provides support for installing OSGi config files by placing 
 them in external directories. So one can place config file in sling 
 home/install folder and they would be automatically installed by Sling OSGi 
 Installer upon system start. Further these config are given higher priority 
 over packaged config file.
 This logic fails to work on Windows. For example if place config through 
 org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file 
 and same file is also packaged within the launchpad then only the launchpad 
 one is picked up. Sling Installer tab on WebConsole shows following entries
 Entry 1
 -
 EntityId - 
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
  
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.47a70bec-964a-4655-b6c4-141dc22c354b
   
 ba55ef93ba200825e9cf9fa7fcff14d3/100
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
  
 INSTALLED 11:56:09:406 2014-Mar-19
 Entry 2
 --
 EntityId  - org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService 
   
 4e2f24f28879a116c45e7aea547909fd/55 
 launchpad:resources/config/crx3tar/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config
 
 INSTALLED 11:56:09:542 2014-Mar-19
 --
 As cane be seen EntityId for external file is not correct due to which it 
 does not get proper pid. Hence any config created via external file route 
 would not work on Windows



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (SLING-3463) Config files cannot be installed via FileProvider on Windows

2014-03-19 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3463.


   Resolution: Fixed
Fix Version/s: Installer Configuration Factory 1.0.12
 Assignee: Chetan Mehrotra

 Config files cannot be installed via FileProvider on Windows
 

 Key: SLING-3463
 URL: https://issues.apache.org/jira/browse/SLING-3463
 Project: Sling
  Issue Type: Bug
  Components: Installer
Affects Versions: Installer Configuration Factory 1.0.10
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
 Fix For: Installer Configuration Factory 1.0.12

 Attachments: SLING-3463.patch


 Sling Installer provides support for installing OSGi config files by placing 
 them in external directories. So one can place config file in sling 
 home/install folder and they would be automatically installed by Sling OSGi 
 Installer upon system start. Further these config are given higher priority 
 over packaged config file.
 This logic fails to work on Windows. For example if place config through 
 org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file 
 and same file is also packaged within the launchpad then only the launchpad 
 one is picked up. Sling Installer tab on WebConsole shows following entries
 Entry 1
 -
 EntityId - 
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
  
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.47a70bec-964a-4655-b6c4-141dc22c354b
   
 ba55ef93ba200825e9cf9fa7fcff14d3/100
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
  
 INSTALLED 11:56:09:406 2014-Mar-19
 Entry 2
 --
 EntityId  - org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService 
   
 4e2f24f28879a116c45e7aea547909fd/55 
 launchpad:resources/config/crx3tar/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config
 
 INSTALLED 11:56:09:542 2014-Mar-19
 --
 As cane be seen EntityId for external file is not correct due to which it 
 does not get proper pid. Hence any config created via external file route 
 would not work on Windows



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (SLING-3463) Config files cannot be installed via FileProvider on Windows

2014-03-19 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13941376#comment-13941376
 ] 

Chetan Mehrotra commented on SLING-3463:


bq. however I would just use File.separatorChar and replace File.separatorChar 
with /

That can be used but then testcase would not pass on Unix system as there we 
forcefully use a Windows path for test. 

Applied the patch with http://svn.apache.org/r1579534



 Config files cannot be installed via FileProvider on Windows
 

 Key: SLING-3463
 URL: https://issues.apache.org/jira/browse/SLING-3463
 Project: Sling
  Issue Type: Bug
  Components: Installer
Affects Versions: Installer Configuration Factory 1.0.10
Reporter: Chetan Mehrotra
 Fix For: Installer Configuration Factory 1.0.12

 Attachments: SLING-3463.patch


 Sling Installer provides support for installing OSGi config files by placing 
 them in external directories. So one can place config file in sling 
 home/install folder and they would be automatically installed by Sling OSGi 
 Installer upon system start. Further these config are given higher priority 
 over packaged config file.
 This logic fails to work on Windows. For example if place config through 
 org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg file 
 and same file is also packaged within the launchpad then only the launchpad 
 one is picked up. Sling Installer tab on WebConsole shows following entries
 Entry 1
 -
 EntityId - 
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
  
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx.47a70bec-964a-4655-b6c4-141dc22c354b
   
 ba55ef93ba200825e9cf9fa7fcff14d3/100
 fileinstallc17bbadb679768c7784c80352bf17196:C:\Data\Work\InstalledSoftware\granite\crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
  
 INSTALLED 11:56:09:406 2014-Mar-19
 Entry 2
 --
 EntityId  - org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService 
   
 4e2f24f28879a116c45e7aea547909fd/55 
 launchpad:resources/config/crx3tar/org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.config
 
 INSTALLED 11:56:09:542 2014-Mar-19
 --
 As cane be seen EntityId for external file is not correct due to which it 
 does not get proper pid. Hence any config created via external file route 
 would not work on Windows



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: [VOTE RESULT] Release Apache Sling Commons Log 4.0.0

2014-03-06 Thread Chetan Mehrotra
Thanks Carsten!!
Chetan Mehrotra


On Fri, Mar 7, 2014 at 11:44 AM, Carsten Ziegeler cziege...@apache.org wrote:
 Hi,

 I've released the artifact, updated the dist dir, jira and the website

 Carsten


 2014-03-05 14:49 GMT+01:00 Chetan Mehrotra chetan.mehro...@gmail.com:

 Hi,

 The vote has passed with the following result :

 +1 (binding): Carsten Ziegeler, Bertrand Delacretaz and Ian Boston
 +1 (non binding): Chetan Mehrotra

 Thanks everyone for voting

 Can someone from PMC team promote the release?

 Chetan Mehrotra




 --
 Carsten Ziegeler
 cziege...@apache.org


[VOTE RESULT] Release Apache Sling Commons Log 4.0.0

2014-03-05 Thread Chetan Mehrotra
Hi,

The vote has passed with the following result :

+1 (binding): Carsten Ziegeler, Bertrand Delacretaz and Ian Boston
+1 (non binding): Chetan Mehrotra

Thanks everyone for voting

Can someone from PMC team promote the release?

Chetan Mehrotra


Re: [VOTE] Release Apache Sling Commons Log 4.0.0

2014-03-04 Thread Chetan Mehrotra
One more binding vote required!!

Chetan Mehrotra


On Tue, Mar 4, 2014 at 6:33 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 +1, checked signatures, build and that the below archive matches the
 corresponding svn tag:

 MD5 
 (./org.apache.sling.commons.log/4.0.0/org.apache.sling.commons.log-4.0.0-source-release.zip)
 = 1b0cfce87b564c4a6ff6b5731d11bb89


 -Bertrand


Re: [VOTE] Release Apache Sling Commons Log 4.0.0

2014-03-02 Thread Chetan Mehrotra
Hi Justin,

As per Sling Release Process [1] I have my key listed under
https://people.apache.org/keys/group/sling.asc. Do I have to publish
it in some other place also?

Chetan Mehrotra
[1] 
http://sling.apache.org/documentation/development/release-management.html#appendix-a-create-and-add-your-key-to-httpspeopleapacheorgkeysgroupslingasc


On Mon, Mar 3, 2014 at 4:08 AM, Justin Edelson jus...@justinedelson.com wrote:
 Hi Chetan,
 I think your GPG key is missing from
 http://svn.apache.org/repos/asf/sling/trunk/KEYS

 Please add it.

 Regards,
 Justin

 On Thu, Feb 27, 2014 at 6:13 AM, Chetan Mehrotra
 chetan.mehro...@gmail.com wrote:
 +1 (Non Binding)

 Chetan Mehrotra


 On Thu, Feb 27, 2014 at 4:42 PM, Chetan Mehrotra
 chetan.mehro...@gmail.com wrote:
 Hi,

 This is to vote for the Apache Sling Commons Log 4.0.0 release. This
 is the first release which uses Logback as the logging backend. We
 solved 20 issues in this release

 The docs are up to date at
 http://sling.apache.org/documentation/development/logging.html

 Issues fixed
 https://issues.apache.org/jira/browse/SLING/fixforversion/12324947

 Release Notes
 https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12324947projectId=12310710

 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1014/

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1014 /tmp/sling-staging

 Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

 This vote will be open for 72 hours.

 Chetan Mehrotra


[jira] [Updated] (SLING-3421) logback initialization does not initialize correct loggers if there's a single false one

2014-02-28 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3421:
---

Description: 
If you configure a logger wrongly, which eg results in this stacktrace:

{code}
2014-02-28 11:59:17  ERROR  LogbackManager  Error occurred while configuring 
Logback

java.lang.IllegalArgumentException: Cannot format given Object as a Date
 at java.text.DateFormat.format(DateFormat.java:281)
 at java.text.Format.format(Format.java:140)
 at java.text.MessageFormat.subformat(MessageFormat.java:1288)
 at java.text.MessageFormat.format(MessageFormat.java:836)
 at java.text.Format.format(Format.java:140)
 at java.text.MessageFormat.format(MessageFormat.java:812)
 at 
org.apache.sling.commons.log.logback.internal.LogConfig.createLayout(LogConfig.java:124)
 at 
org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.addLogConfig(LoggerSpecificEncoder.java:72)
 at 
org.apache.sling.commons.log.logback.internal.LogConfigManager.onResetComplete(LogConfigManager.java:283)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager.fireResetCompleteListeners(LogbackManager.java:266)
 at 
org.apache.sling.commons.log.logback.internal.OsgiInternalAction$ConfigCompleteListener.inPlay(OsgiInternalAction.java:158)
 at 
ch.qos.logback.core.joran.spi.InterpretationContext.fireInPlay(InterpretationContext.java:183)
 at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:61)
 at 
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
 at 
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
 at 
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
 at 
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager$DefaultCallback.perform(LogbackManager.java:574)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:322)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:303)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager.access$200(LogbackManager.java:51)
 at 
org.apache.sling.commons.log.logback.internal.LogbackManager$1.run(LogbackManager.java:251)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
 at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
 at java.lang.Thread.run(Thread.java:695)

{code}

logback initialization stops completely and no other logger will be honored.

I think the logback initialization should continue and just mark the failing 
one prominently, instead of completely stopping.

  was:
If you configure a logger wrongly, which eg results in this stacktrace:

{code}
java.io.IOException: Bad file descriptor
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:282)
at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at 
ch.qos.logback.core.recovery.ResilientOutputStreamBase.flush(ResilientOutputStreamBase.java:79)
at 
org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.doEncode(LoggerSpecificEncoder.java:46)
at 
org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.doEncode(LoggerSpecificEncoder.java:34)
at 
ch.qos.logback.core.OutputStreamAppender.writeOut(OutputStreamAppender.java:188)
at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:206)
at 
ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)
at 
ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:175)
at 
ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
at 
ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
at 
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
at 
ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
at ch.qos.logback.classic.Logger.log(Logger.java:788)
at 
org.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:620)
{code}

logback

[jira] [Commented] (SLING-3421) logback initialization does not initialize correct loggers if there's a single false one

2014-02-28 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13915687#comment-13915687
 ] 

Chetan Mehrotra commented on SLING-3421:


One thing to note that logging would still work and all log message with level 
INFO+ would be directed to stdout.log. So no loss of imp log message here. 

Would update the configuration logic to handle such cases if possible and 
ignore malformed message formats


 logback initialization does not initialize correct loggers if there's a 
 single false one
 

 Key: SLING-3421
 URL: https://issues.apache.org/jira/browse/SLING-3421
 Project: Sling
  Issue Type: Bug
  Components: Commons
Reporter: Stefan Egli
Assignee: Chetan Mehrotra

 If you configure a logger wrongly, which eg results in this stacktrace:
 {code}
 2014-02-28 11:59:17  ERROR  LogbackManager  Error occurred while configuring 
 Logback
 java.lang.IllegalArgumentException: Cannot format given Object as a Date
  at java.text.DateFormat.format(DateFormat.java:281)
  at java.text.Format.format(Format.java:140)
  at java.text.MessageFormat.subformat(MessageFormat.java:1288)
  at java.text.MessageFormat.format(MessageFormat.java:836)
  at java.text.Format.format(Format.java:140)
  at java.text.MessageFormat.format(MessageFormat.java:812)
  at 
 org.apache.sling.commons.log.logback.internal.LogConfig.createLayout(LogConfig.java:124)
  at 
 org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.addLogConfig(LoggerSpecificEncoder.java:72)
  at 
 org.apache.sling.commons.log.logback.internal.LogConfigManager.onResetComplete(LogConfigManager.java:283)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager.fireResetCompleteListeners(LogbackManager.java:266)
  at 
 org.apache.sling.commons.log.logback.internal.OsgiInternalAction$ConfigCompleteListener.inPlay(OsgiInternalAction.java:158)
  at 
 ch.qos.logback.core.joran.spi.InterpretationContext.fireInPlay(InterpretationContext.java:183)
  at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:61)
  at 
 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
  at 
 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
  at 
 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
  at 
 ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager$DefaultCallback.perform(LogbackManager.java:574)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:322)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:303)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager.access$200(LogbackManager.java:51)
  at 
 org.apache.sling.commons.log.logback.internal.LogbackManager$1.run(LogbackManager.java:251)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
  at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
  at java.lang.Thread.run(Thread.java:695)
 {code}
 logback initialization stops completely and no other logger will be honored.
 I think the logback initialization should continue and just mark the failing 
 one prominently, instead of completely stopping.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3410) Log the Logback initialization related logs to normal log for transient errors

2014-02-27 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3410.


Resolution: Fixed

Fix implemented seems to work for now. Resolving the bug

 Log the Logback initialization related logs to normal log for transient errors
 --

 Key: SLING-3410
 URL: https://issues.apache.org/jira/browse/SLING-3410
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Currently Sling Log would dump Logback status message to system out in case 
 some warning/error are observed in Logback initialization. If the overall 
 Logback initialization is successful then these logs should be logged as part 
 of normal logging flow



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[VOTE] Release Apache Sling Commons Log 4.0.0

2014-02-27 Thread Chetan Mehrotra
Hi,

This is to vote for the Apache Sling Commons Log 4.0.0 release. This
is the first release which uses Logback as the logging backend. We
solved 20 issues in this release

The docs are up to date at
http://sling.apache.org/documentation/development/logging.html

Issues fixed
https://issues.apache.org/jira/browse/SLING/fixforversion/12324947

Release Notes
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12324947projectId=12310710

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1014/

You can use this UNIX script to download the release and verify the
signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1014 /tmp/sling-staging

Please vote to approve this release:

 [ ] +1 Approve the release
 [ ]  0 Don't care
 [ ] -1 Don't release, because ...

This vote will be open for 72 hours.

Chetan Mehrotra


Re: [VOTE] Release Apache Sling Commons Log 4.0.0

2014-02-27 Thread Chetan Mehrotra
+1 (Non Binding)

Chetan Mehrotra


On Thu, Feb 27, 2014 at 4:42 PM, Chetan Mehrotra
chetan.mehro...@gmail.com wrote:
 Hi,

 This is to vote for the Apache Sling Commons Log 4.0.0 release. This
 is the first release which uses Logback as the logging backend. We
 solved 20 issues in this release

 The docs are up to date at
 http://sling.apache.org/documentation/development/logging.html

 Issues fixed
 https://issues.apache.org/jira/browse/SLING/fixforversion/12324947

 Release Notes
 https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12324947projectId=12310710

 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1014/

 You can use this UNIX script to download the release and verify the
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

 Usage:
 sh check_staged_release.sh 1014 /tmp/sling-staging

 Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

 This vote will be open for 72 hours.

 Chetan Mehrotra


[jira] [Resolved] (SLING-3045) [logback]Warning logs logged for 'No appenders present in context [sling] for logger'

2014-02-25 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3045.


Resolution: Fixed

In some cases such logs would be observed and cannot be avoided. These are 
handled in a better way with SLING-3410

 [logback]Warning logs logged for 'No appenders present in context [sling] for 
 logger'
 -

 Key: SLING-3045
 URL: https://issues.apache.org/jira/browse/SLING-3045
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0

 Attachments: SLING-3045.patch


 During system startup at times following warning is seen
 ---
 14:48:24,969 |-WARN in 
 Logger[org.apache.sling.installer.core.impl.OsgiInstallerImpl] - No appenders 
 present in context [sling] for logger 
 [org.apache.sling.installer.core.impl.OsgiInstallerImpl].
 ---
 Further some debug level logs are also seen during the startup



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3364) All rotated log files are not made part of the zip provided through webconsole

2014-02-25 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3364.


Resolution: Fixed

Added support in http://svn.apache.org/r1571618

This fix would enable including files which are rotated via simple patterns 
i.e. which do not change the prefix, which do not create rotated file in 
different directory etc would get included in zip



 All rotated log files are not made part of the zip provided through webconsole
 --

 Key: SLING-3364
 URL: https://issues.apache.org/jira/browse/SLING-3364
 Project: Sling
  Issue Type: Bug
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
 Fix For: Commons Log 4.0.0


 Sling Log bundle so far provided ability to dump all the rotated log files as 
 part of zip generated via Felix WebConsole support. With shift to Logback its 
 not straightforward to  determine location of all rotated logs files e.g. one 
 created via config xml 
 Need to find a way to determine all such rotated log files and dump them. 
 1. Dump all files from log folder
 2. Dump only the file created via OSGi configuration as we know the pattern 
 used and then use a logic similar to earlier version to determine all such 
 files. For files generated by other appenders (one configured via xml) its 
 not possible to determine the pattern post initialization



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3410) Log the Logback initialization related logs to normal log for transient errors

2014-02-24 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3410:
--

 Summary: Log the Logback initialization related logs to normal log 
for transient errors
 Key: SLING-3410
 URL: https://issues.apache.org/jira/browse/SLING-3410
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor


Currently Sling Log would dump Logback status message to system out in case 
some warning/error are observed in Logback initialization. If the overall 
Logback initialization is successful then these logs should be logged as part 
of normal logging flow



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3410) Log the Logback initialization related logs to normal log for transient errors

2014-02-24 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13910302#comment-13910302
 ] 

Chetan Mehrotra commented on SLING-3410:


Added support in r1571283 and r1571284

Now in case transient issues are observed in Logback status then those logs 
would be routed to normal logs and a marker '\*Logback Status\*' would be added 
to line as shown below.

In case Logback was not successfully initialized then this marker would not be 
added. 

{noformat}
19:01:05,627 *Logback Status* |-WARN in 
org.apache.sling.commons.log.logback.internal.LogbackManager@6563068f - 
Context: sling reloaded.
19:01:05,631 *Logback Status* |-INFO in 
ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not 
set
{noformat}

 Log the Logback initialization related logs to normal log for transient errors
 --

 Key: SLING-3410
 URL: https://issues.apache.org/jira/browse/SLING-3410
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Currently Sling Log would dump Logback status message to system out in case 
 some warning/error are observed in Logback initialization. If the overall 
 Logback initialization is successful then these logs should be logged as part 
 of normal logging flow



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (SLING-3410) Log the Logback initialization related logs to normal log for transient errors

2014-02-24 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3410:
---

Fix Version/s: Commons Log 4.0.0

 Log the Logback initialization related logs to normal log for transient errors
 --

 Key: SLING-3410
 URL: https://issues.apache.org/jira/browse/SLING-3410
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Currently Sling Log would dump Logback status message to system out in case 
 some warning/error are observed in Logback initialization. If the overall 
 Logback initialization is successful then these logs should be logged as part 
 of normal logging flow



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3411) Enable configuring the maxCallerDataDepth in Logback LoggerContext

2014-02-24 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3411:
--

 Summary: Enable configuring the maxCallerDataDepth in Logback 
LoggerContext
 Key: SLING-3411
 URL: https://issues.apache.org/jira/browse/SLING-3411
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


Logback support dumping the caller statcktrace [1] as part of the log message. 
By default it computes upto 7 frames. However in case of Sling most of the time 
these 7 frames are consumed by Sling framework classes itself

To see application code frames this limits needs to be increased

[1] http://logback.qos.ch/manual/layouts.html#caller



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3275) Add Buffered Logging Configuration in Apache Sling Logging Logger

2014-02-24 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3275.


Resolution: Fixed

Added support in [r1571319|http://svn.apache.org/r1571319]

LogWriter config now has option to enable buffered logging configured via 
'org.apache.sling.commons.log.file.buffered' property

 Add Buffered Logging Configuration in Apache Sling Logging Logger
 ---

 Key: SLING-3275
 URL: https://issues.apache.org/jira/browse/SLING-3275
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor

 Logback supports buffered logging [1]. As of now it can be used directly by 
 configuring the appender via Logback xml file [2]. To simplify its usage we 
 should expose a config as part of OSGi config
 [1] http://logback.qos.ch/manual/encoders.html#immediateFlush
 [2] 
 http://sling.apache.org/documentation/development/logging.html#wzxhzdk13wzxhzdk14configuring-osgi-appenders-in-the-logback-config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (SLING-3275) Add Buffered Logging Configuration in Apache Sling Logging Logger

2014-02-24 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3275:
---

Fix Version/s: Commons Log 4.0.0

 Add Buffered Logging Configuration in Apache Sling Logging Logger
 ---

 Key: SLING-3275
 URL: https://issues.apache.org/jira/browse/SLING-3275
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Logback supports buffered logging [1]. As of now it can be used directly by 
 configuring the appender via Logback xml file [2]. To simplify its usage we 
 should expose a config as part of OSGi config
 [1] http://logback.qos.ch/manual/encoders.html#immediateFlush
 [2] 
 http://sling.apache.org/documentation/development/logging.html#wzxhzdk13wzxhzdk14configuring-osgi-appenders-in-the-logback-config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3411) Enable configuring the maxCallerDataDepth in Logback LoggerContext

2014-02-24 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3411.


Resolution: Fixed

Added support in [r1571318|http://svn.apache.org/r1571318].

One can set the maxCallerDepth by configuring the 'Sling Commons Logging' 
config 

 Enable configuring the maxCallerDataDepth in Logback LoggerContext
 --

 Key: SLING-3411
 URL: https://issues.apache.org/jira/browse/SLING-3411
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Logback support dumping the caller statcktrace [1] as part of the log 
 message. By default it computes upto 7 frames. However in case of Sling most 
 of the time these 7 frames are consumed by Sling framework classes itself
 To see application code frames this limits needs to be increased
 [1] http://logback.qos.ch/manual/layouts.html#caller



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3340) Warnings on startup regarding no-op loggers

2014-02-23 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13910061#comment-13910061
 ] 

Chetan Mehrotra commented on SLING-3340:


Updated the Slf4j related bundle versions in http://svn.apache.org/r1571156

 Warnings on startup regarding no-op loggers
 ---

 Key: SLING-3340
 URL: https://issues.apache.org/jira/browse/SLING-3340
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Depening on the order in which bundles are installed Slf4j might use NoOp 
 loggers for loggers created before Logback is initialized. One would see a 
 warning log like below
 {noformat}
 Slf4j is not initialized yet. Delaying Logback support initialization
 SLF4J: The following loggers will not work because they were created
 SLF4J: during the default configuration phase of the underlying logging 
 system.
 SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
 SLF4J: org.apache.sling.commons.logservice
 SLF4J: org.apache.sling.installer.core
 SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
 SLF4J: org.apache.sling.audit.osgi.installer
 SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
 SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
 SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
 SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
 SLF4J: org.apache.sling.installer.provider.file
 SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
 SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
 SLF4J: org.apache.sling.javax.activation
 SLF4J: org.apache.sling.javax.activation.internal.Activator
 SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
 SLF4J: org.apache.sling.launchpad.installer
 SLF4J: org.apache.sling.settings
 SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
 SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
 SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask
 {noformat}
 Given that log from Sling installer category are important and should not be 
 lost we should avoid such scenario to be created.
 See thread http://markmail.org/thread/n4zyj5akkh24ahh5



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3383) Non stopping thread in AbstractJobQueue causes classloader leak

2014-02-19 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13905102#comment-13905102
 ] 

Chetan Mehrotra commented on SLING-3383:


Not sure on easy way. You can possibly try refreshing the Event bundle multiple 
times and then use the Classloader Leak Detector (SLING-3359) to see if it 
highlights any leak

 Non stopping thread in AbstractJobQueue causes classloader leak 
 

 Key: SLING-3383
 URL: https://issues.apache.org/jira/browse/SLING-3383
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Event 3.3.4
Reporter: Chetan Mehrotra
Assignee: Carsten Ziegeler
 Fix For: Event 3.3.6


 While analyzing heap dump for classloader leaks using script [1] following 
 possible leak was reported 
 {noformat}
   org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
Following are few of the live paths found
Live path
   
 org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
   java.lang.Thread@0x12547e888
   [Ljava.lang.Thread;@0x124f18f58
   java.lang.ThreadGroup@0x123346e80
   java.lang.Thread@0x126635c48
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x13161da50
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253e0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253c0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253a0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a128c90
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c198
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c178
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c158
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c138
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c118
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0f8
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0d8
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0b8
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c098
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c078
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c058
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e30
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e10
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007df0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007dd0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007db0
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d90
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d70
   
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@0x125d2c968
   java.lang.Thread@0x126637b00
   java.util.concurrent.ThreadPoolExecutor$Worker@0x126637b68
   java.util.HashMap$Entry@0x126640058
   [Ljava.util.HashMap$Entry;@0x12663fde8
   java.util.HashMap@0x125d2ca08
   java.util.HashSet@0x125d2c9f8
   java.util.concurrent.ThreadPoolExecutor@0x125d2c8a0
   
 org.apache.sling.commons.threads.impl.DefaultThreadPool@0x125d2c7b0 [*]
   
 org.apache.sling.commons.threads.impl.ThreadPoolFacade@0x125d2c798 [*]
   
 org.apache.sling.commons.threads.impl.DefaultThreadPoolManager$Entry@0x125d535d0
  [*]
   java.util.HashMap$Entry@0x125d535b0
   [Ljava.util.HashMap$Entry;@0x124147940
   java.util.HashMap@0x124147910
   
 org.apache.sling.commons.threads.impl.DefaultThreadPoolManager@0x124146e50 [*]
   org.apache.felix.framework.ServiceRegistrationImpl@0x12414f3e8
   org.apache.sling.commons.threads.impl.Activator@0x12414f3d0 [*]
   org.apache.felix.framework.BundleImpl@0x122809f78
   org.apache.felix.framework.ServiceRegistrationImpl@0x1241e8c40
   class org.apache.sling.commons.threads.impl.WebConsolePrinter
   
 org.apache.sling.commons.threads.impl.WebConsolePrinter@0x1241e8a70 [*]
 {noformat}
 It appears that the thread created

Re: Installation and start order for logging (was: [jira] [Commented] (SLING-3386) Enable support starting bundle in custom oreder at start level 1)

2014-02-17 Thread Chetan Mehrotra
Hi Carsten,

To summarize.

1. Need to clear the start level 1 and keep only logging related
bundles and framework fragments at that level. Move all other bundles
to Start Level 2
2. For upgraded system we implement a new Bootstrap command say
ChangeStartLevelCommand. This would change the start level of bundle
from a to b. This would then be used to implement #1
3. For new system the list.xml needs to be updated

I would be trying out #2 and come back to the list on how it works in
practice. It might take some time given some other work in progress

Chetan Mehrotra


On Mon, Feb 17, 2014 at 5:37 PM, Carsten Ziegeler cziege...@apache.org wrote:
 Can someone please summarize what exactly is proposed, especially for
 SLING-3388 ?

 Thanks
 Carsten


 2014-02-12 11:14 GMT+01:00 Felix Meschberger fmesc...@adobe.com:


 Am 12.02.2014 um 11:01 schrieb Chetan Mehrotra chetan.mehro...@gmail.com
 :

  For now I think we can keep the implementation simple. For example in
  current case we do not have to change start level for Fragments and
  Slf4j related bundle. So need to change start level of some listed
  bundles only
 
  startlevel 20 40
  Do not see a requirement to move all existing bundle to different level

 ok

 
  startlevel .* 2
  startlevel .*\.installer\..* 2
 
  For now would like to keep it simple to
 
  changestartlevel symbolic name:version? target level

 I still would suggest to support a version range, though.

 
  If need arises for more advance usecase then they can be added later
 
  Created  SLING-3388 for the same.

 Thanks
 Felix

  Chetan Mehrotra
 
 
  On Wed, Feb 12, 2014 at 2:58 PM, Felix Meschberger fmesc...@adobe.com
 wrote:
  Hi
 
  Am 12.02.2014 um 09:58 schrieb Felix Meschberger fmesc...@adobe.com:
 
  Hi
 
  Am 12.02.2014 um 09:22 schrieb Chetan Mehrotra 
 chetan.mehro...@gmail.com:
 
  On Wed, Feb 12, 2014 at 1:26 PM, Felix Meschberger 
 fmesc...@adobe.com wrote:
  Hence, I would really prefer to get our start levels straight and
 reserve 1 to logging and move the install stuff to 2.
 
  You never allow to take the short cut :)
 
  I fight special cases as long as possible, yes :-)
 
 
  Okie thinking about tackling the real problem of moving existing
  bundle to start level  1 I can think of following approach
 
  1. Currently we are not using startlevel 2,3,4
 
  Yes.
 
 
  2. Introduce a new command ChangeStartLevelCommand which would use the
  StartLevel service to change the start level of non fragment bundle
  having existing level 1. or it can be generic to change the level from
  a - b.
 
  One thing to decide at this step is that command should work on
  explicit parameters e.g. change start level only for list bundles
  OR Is an automatic one where it would find all bundles at 1 and change
  levels for non fragment and non logging related bundle
 
  You mean a command for  bootstrap.txt like uninstall ? Sounds good.
 
  This command could take a regular expression for symbolic names and
 optionally a version range to select bundles and then a target start level.
 Optionally it could take a source start level and a target start level to
 move all bundles with the source start level to the target start level
 
  EBND definition:
 
   StartLevelCommand = startlevel Source TargetStartLevel .
   Source = SourceStartLevel
  | Bundle .
   SourceStartLevel = numeric startlevel value  0 .
   TargetStartLevel = numeric startlevel value  0 .
   Bundle = BundleSymbolicName VersionRange .
   BundleSymbolicName = regular expression match for bundle symbolic name
 .
   VersionRange = OSGi version range to match bundles .
 
  Examples:
 
   # move all bundles currently set to startlevel 20 to startlevel 40
   startlevel 20 40
 
   # move all bundles to startlevel 2
   startlevel .* 2
 
   # move installer bundles to startlevel 2
   startlevel .*\.installer\..* 2
 
  Regards
  Felix
 
 
  +1
 
 
  3. Change the list.xml and move non fragment bundle (except loggging
  related) to level 2
 
  +1
 
 
  Would this work or is something missing here?
 
  Sounds good to me.
 
  Regards
  Felix
 
 
  Chetan Mehrotra
 
 




 --
 Carsten Ziegeler
 cziege...@apache.org


Enabling Github integration for Apache Sling Infra

2014-02-16 Thread Chetan Mehrotra
Saw this news regarding Github and Apache infra integration [1]. I
would be good if we get these features enabled for Sling.

thoughts?

Chetan Mehrotra
[1] https://blogs.apache.org/infra/entry/improved_integration_between_apache_and


Re: Installation and start order for logging (was: [jira] [Commented] (SLING-3386) Enable support starting bundle in custom oreder at start level 1)

2014-02-12 Thread Chetan Mehrotra
On Wed, Feb 12, 2014 at 1:26 PM, Felix Meschberger fmesc...@adobe.com wrote:
 Hence, I would really prefer to get our start levels straight and reserve 1 
 to logging and move the install stuff to 2.

You never allow to take the short cut :)

Okie thinking about tackling the real problem of moving existing
bundle to start level  1 I can think of following approach

1. Currently we are not using startlevel 2,3,4

2. Introduce a new command ChangeStartLevelCommand which would use the
StartLevel service to change the start level of non fragment bundle
having existing level 1. or it can be generic to change the level from
a - b.

One thing to decide at this step is that command should work on
explicit parameters e.g. change start level only for list bundles
OR Is an automatic one where it would find all bundles at 1 and change
levels for non fragment and non logging related bundle

3. Change the list.xml and move non fragment bundle (except loggging
related) to level 2

Would this work or is something missing here?

Chetan Mehrotra


[jira] [Updated] (SLING-3388) Enable changing of bundle start level in upgrade

2014-02-12 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3388:
---

Description: 
For certain cases we need to change the start level of existing bundles. For 
example to properly solve SLING-3340 we need to move all non log related 
bundles to Start level  1

Currently the Launchpad bootstrap support custom commands which are executed 
upon system start. For now they are used to uninstall bundles.

On similar like we can have changestartlevel command to change the start level 
of bundle

Refer to http://markmail.org/thread/2b5m7hq22p7b5vq3 for more details


  was:
For certain cases we need to change the start level of existing bundles. For 
example to properly solve SLING-3340 we need to move all non log related 
bundles to Start level  1

Currently the Launchpad bootstrap support custom commands which are executed 
upon system start. For now they are used to uninstall bundles.

On similar like we can have changestartlevel command to change the start level 
of bundle




 Enable changing of bundle start level in upgrade
 

 Key: SLING-3388
 URL: https://issues.apache.org/jira/browse/SLING-3388
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 For certain cases we need to change the start level of existing bundles. For 
 example to properly solve SLING-3340 we need to move all non log related 
 bundles to Start level  1
 Currently the Launchpad bootstrap support custom commands which are executed 
 upon system start. For now they are used to uninstall bundles.
 On similar like we can have changestartlevel command to change the start 
 level of bundle
 Refer to http://markmail.org/thread/2b5m7hq22p7b5vq3 for more details



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3386) Enable support starting bundle in custom oreder at start level 1

2014-02-12 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3386.


Resolution: Won't Fix

The original issue would now be addressed via SLING-3388

 Enable support starting bundle in custom oreder at start level 1
 

 Key: SLING-3386
 URL: https://issues.apache.org/jira/browse/SLING-3386
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
Reporter: Chetan Mehrotra
Priority: Minor
 Attachments: SLING-3386.patch


 By default OSGi framework does not define the order in which bundles would be 
 started in a given start level. The only way is to use to use start level.
 However in case of bundle like Logging its desriable that Log bundle is the 
 first bundle to start in the system such that it does not miss any log 
 message. The problem is described in more details at SLING-3340.
 As Sling uses Felix framework by default it is possible to control the start 
 order by controlling the order in which bundles are installed on the 
 framework. As per current Felix Framework implementation [1] bundle within 
 same start level are started in the order of bundleId.
 The way patch works is
 1. Bundle which start at start level 1 can define a header 
 'X-Sling-Start-Order' to provide a start order hint. Lower the level then 
 earlier the bundle would be started
 2. BootstrapInstaller would sort the files obtained from directly listing 
 based on this header. 
 3. Sorted list would be used to install the bundles
 I understand that this is a very much implementation specific fix and might 
 not work if Felix changes the internal logic. But then the feature is meant 
 to be used in best effort basis!!.
 [1] 
 https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3386) Enable support starting bundle in custom oreder at start level 1

2014-02-11 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3386:
--

 Summary: Enable support starting bundle in custom oreder at start 
level 1
 Key: SLING-3386
 URL: https://issues.apache.org/jira/browse/SLING-3386
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
Reporter: Chetan Mehrotra
Priority: Minor


By default OSGi framework does not define the order in which bundles would be 
started in a given start level. The only way is to use to use start level.

However in case of bundle like Logging its desriable that Log bundle is the 
first bundle to start in the system such that it does not miss any log message. 
The problem is described in more details at SLING-3340.

As Sling uses Felix framework by default it is possible to control the start 
order by controlling the order in which bundles are installed on the framework. 
As per current Felix Framework implementation [1] bundle within same start 
level are started in the order of bundleId.

The way patch works is

1. Bundle which start at start level 1 can define a header 
'X-Sling-Start-Order' to provide a start order hint. Lower the level then 
earlier the bundle would be started
2. BootstrapInstaller would sort the files obtained from directly listing based 
on this header. 
3. Sorted list would be used to install the bundles

I understand that this is a very much implementation specific fix and might not 
work if Felix changes the internal logic. But then the feature is meant to be 
used in best effort basis!!.

[1] 
https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873





--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (SLING-3386) Enable support starting bundle in custom oreder at start level 1

2014-02-11 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3386:
---

Attachment: SLING-3386.patch

Patch as per approach explained above

 Enable support starting bundle in custom oreder at start level 1
 

 Key: SLING-3386
 URL: https://issues.apache.org/jira/browse/SLING-3386
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
Reporter: Chetan Mehrotra
Priority: Minor
 Attachments: SLING-3386.patch


 By default OSGi framework does not define the order in which bundles would be 
 started in a given start level. The only way is to use to use start level.
 However in case of bundle like Logging its desriable that Log bundle is the 
 first bundle to start in the system such that it does not miss any log 
 message. The problem is described in more details at SLING-3340.
 As Sling uses Felix framework by default it is possible to control the start 
 order by controlling the order in which bundles are installed on the 
 framework. As per current Felix Framework implementation [1] bundle within 
 same start level are started in the order of bundleId.
 The way patch works is
 1. Bundle which start at start level 1 can define a header 
 'X-Sling-Start-Order' to provide a start order hint. Lower the level then 
 earlier the bundle would be started
 2. BootstrapInstaller would sort the files obtained from directly listing 
 based on this header. 
 3. Sorted list would be used to install the bundles
 I understand that this is a very much implementation specific fix and might 
 not work if Felix changes the internal logic. But then the feature is meant 
 to be used in best effort basis!!.
 [1] 
 https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3386) Enable support starting bundle in custom oreder at start level 1

2014-02-11 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13898791#comment-13898791
 ] 

Chetan Mehrotra commented on SLING-3386:


bq. treat logging specially in that we define a new folder which is handled 
first by the bootstrap installer

The patch takes a bit different route but aim is same i.e. enable influencing 
the order in which bootstrap installer would install bundle files

bq. move all non-logging bundles from startlevel 1 to startlevel 2

That would be the proper and stable fix. However it would cause issue in case 
of upgrades as we would have to change the bundle start levels. Such a change 
would require lot more effort and we would need to ensure that all cases are 
handled properly. Thats the reason I am taking the proposed approach as it is a 
small change in current startup process. And yes this fix would also not handle 
the upgrade scenario

bq. The BundleStartLevelSorter.parseStartOrder may throw an exception if the 
header happens to not be an Integer.

I thought about that but then I preferred to have a fail fast approach where if 
there is a problem in value then it gets noticed right away.

bq. Also every reference to start order (or even start level in that method) 
would have to be rephrased to install order. Also, I would call the header 
X-Sling-Bootstrap-Install-Order to indicate it is just the bootstrap 
installer respecting this as the installation order.

Ack. Would change that.





 Enable support starting bundle in custom oreder at start level 1
 

 Key: SLING-3386
 URL: https://issues.apache.org/jira/browse/SLING-3386
 Project: Sling
  Issue Type: Improvement
  Components: Launchpad
Affects Versions: Launchpad Base 2.5.0
Reporter: Chetan Mehrotra
Priority: Minor
 Attachments: SLING-3386.patch


 By default OSGi framework does not define the order in which bundles would be 
 started in a given start level. The only way is to use to use start level.
 However in case of bundle like Logging its desriable that Log bundle is the 
 first bundle to start in the system such that it does not miss any log 
 message. The problem is described in more details at SLING-3340.
 As Sling uses Felix framework by default it is possible to control the start 
 order by controlling the order in which bundles are installed on the 
 framework. As per current Felix Framework implementation [1] bundle within 
 same start level are started in the order of bundleId.
 The way patch works is
 1. Bundle which start at start level 1 can define a header 
 'X-Sling-Start-Order' to provide a start order hint. Lower the level then 
 earlier the bundle would be started
 2. BootstrapInstaller would sort the files obtained from directly listing 
 based on this header. 
 3. Sorted list would be used to install the bundles
 I understand that this is a very much implementation specific fix and might 
 not work if Felix changes the internal logic. But then the feature is meant 
 to be used in best effort basis!!.
 [1] 
 https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3045) [logback]Warning logs logged for 'No appenders present in context [sling] for logger'

2014-02-10 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13896459#comment-13896459
 ] 

Chetan Mehrotra commented on SLING-3045:


Updated the logic in [r1566597|http://svn.apache.org/r1566597] to be more robust

 [logback]Warning logs logged for 'No appenders present in context [sling] for 
 logger'
 -

 Key: SLING-3045
 URL: https://issues.apache.org/jira/browse/SLING-3045
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0

 Attachments: SLING-3045.patch


 During system startup at times following warning is seen
 ---
 14:48:24,969 |-WARN in 
 Logger[org.apache.sling.installer.core.impl.OsgiInstallerImpl] - No appenders 
 present in context [sling] for logger 
 [org.apache.sling.installer.core.impl.OsgiInstallerImpl].
 ---
 Further some debug level logs are also seen during the startup



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3322) Export additional mozilla rhino packages

2014-02-10 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13897562#comment-13897562
 ] 

Chetan Mehrotra commented on SLING-3322:


Applied the patch in [566989|http://svn.apache.org/r1]. Also updated the 
package exports to have versions

Earlier
{noformat}
  org.apache.sling.scripting.javascript 
  org.mozilla.javascript   
{noformat}

Now
{noformat}
  org.apache.sling.scripting.javascript {version=0.1.0, imported-as=[0.1,1)}
  org.mozilla.classfile {version=0.0.0.1_7R4, 
imported-as=[0.0,1)}
  org.mozilla.javascript{version=0.0.0.1_7R4}
  org.mozilla.javascript.debug  {version=0.0.0.1_7R4, 
imported-as=[0.0,1)}
{noformat}

 Export additional  mozilla rhino packages
 -

 Key: SLING-3322
 URL: https://issues.apache.org/jira/browse/SLING-3322
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting JavaScript 2.0.12
Reporter: Rohit Kumar
Priority: Minor
 Fix For: Scripting JavaScript 2.0.14

 Attachments: Sling-3322.patch


 Our project requires following rhino packages:
 org.mozilla.classfile,
 org.mozilla.javascript.debug
 It would be better if Sling exposes them.
 Attaching patch.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3322) Export additional mozilla rhino packages

2014-02-10 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3322.


   Resolution: Fixed
Fix Version/s: Scripting JavaScript 2.0.14
 Assignee: Chetan Mehrotra

 Export additional  mozilla rhino packages
 -

 Key: SLING-3322
 URL: https://issues.apache.org/jira/browse/SLING-3322
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting JavaScript 2.0.12
Reporter: Rohit Kumar
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Scripting JavaScript 2.0.14

 Attachments: Sling-3322.patch


 Our project requires following rhino packages:
 org.mozilla.classfile,
 org.mozilla.javascript.debug
 It would be better if Sling exposes them.
 Attaching patch.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3383) Non stopping thread in AbstractJobQueue causes classloader leak

2014-02-09 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3383:
--

 Summary: Non stopping thread in AbstractJobQueue causes 
classloader leak 
 Key: SLING-3383
 URL: https://issues.apache.org/jira/browse/SLING-3383
 Project: Sling
  Issue Type: Bug
  Components: Extensions
Affects Versions: Event 3.3.4
Reporter: Chetan Mehrotra


While analyzing heap dump for classloader leaks using script [1] following 
possible leak was reported 

{noformat}
org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
 Following are few of the live paths found
 Live path

org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
java.lang.Thread@0x12547e888
[Ljava.lang.Thread;@0x124f18f58
java.lang.ThreadGroup@0x123346e80
java.lang.Thread@0x126635c48

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x13161da50

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253e0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253c0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253a0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a128c90

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c198

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c178

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c158

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c138

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c118

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0f8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0d8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0b8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c098

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c078

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c058

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e30

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e10

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007df0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007dd0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007db0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d90

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d70

java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@0x125d2c968
java.lang.Thread@0x126637b00
java.util.concurrent.ThreadPoolExecutor$Worker@0x126637b68
java.util.HashMap$Entry@0x126640058
[Ljava.util.HashMap$Entry;@0x12663fde8
java.util.HashMap@0x125d2ca08
java.util.HashSet@0x125d2c9f8
java.util.concurrent.ThreadPoolExecutor@0x125d2c8a0

org.apache.sling.commons.threads.impl.DefaultThreadPool@0x125d2c7b0 [*]

org.apache.sling.commons.threads.impl.ThreadPoolFacade@0x125d2c798 [*]

org.apache.sling.commons.threads.impl.DefaultThreadPoolManager$Entry@0x125d535d0
 [*]
java.util.HashMap$Entry@0x125d535b0
[Ljava.util.HashMap$Entry;@0x124147940
java.util.HashMap@0x124147910

org.apache.sling.commons.threads.impl.DefaultThreadPoolManager@0x124146e50 [*]
org.apache.felix.framework.ServiceRegistrationImpl@0x12414f3e8
org.apache.sling.commons.threads.impl.Activator@0x12414f3d0 [*]
org.apache.felix.framework.BundleImpl@0x122809f78
org.apache.felix.framework.ServiceRegistrationImpl@0x1241e8c40
class org.apache.sling.commons.threads.impl.WebConsolePrinter

org.apache.sling.commons.threads.impl.WebConsolePrinter@0x1241e8a70 [*]
{noformat}

It appears that the thread created in AbstractJobQueue [2] is not interrupting 
the thread upon deactivation/shutdown. So the thread remains blocked in waiting 
(in take method of various implementations) and never gets a chance to check 
for the running flag. A better way would be to handle the InterruptedException 
properly [3] and exit the thread as part of InterruptedException exception 
handling

[1] https://gist.github.com/chetanmeh/8860776 
[2] 
https://github.com/apache/sling/blob/trunk

[jira] [Commented] (SLING-3359) Classloader Leak Detector Console Tab

2014-02-09 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13896261#comment-13896261
 ] 

Chetan Mehrotra commented on SLING-3359:


As an extension one can found out possible leak suspects (actual root cause) 
using the script provided at [1]. This script can be executed as part of jHat 
OQL [2]. The script dumps the report printing out the live path of object which 
is preventing it from getting GC. Below is a portion of the report generated 
from one of the heap dumps analyzed

{noformat}
org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
 Following are few of the live paths found
 Live path

org.apache.sling.event.impl.jobs.queues.AbstractJobQueue$1@0x12547e960
java.lang.Thread@0x12547e888
[Ljava.lang.Thread;@0x124f18f58
java.lang.ThreadGroup@0x123346e80
java.lang.Thread@0x126635c48

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x13161da50

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253e0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253c0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x1318253a0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a128c90

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c198

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c178

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c158

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c138

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c118

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0f8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0d8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c0b8

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c098

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c078

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a24c058

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e30

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007e10

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007df0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007dd0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007db0

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d90

java.util.concurrent.locks.AbstractQueuedSynchronizer$Node@0x12a007d70

java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@0x125d2c968
java.lang.Thread@0x126637b00
java.util.concurrent.ThreadPoolExecutor$Worker@0x126637b68
java.util.HashMap$Entry@0x126640058
[Ljava.util.HashMap$Entry;@0x12663fde8
java.util.HashMap@0x125d2ca08
java.util.HashSet@0x125d2c9f8
java.util.concurrent.ThreadPoolExecutor@0x125d2c8a0

org.apache.sling.commons.threads.impl.DefaultThreadPool@0x125d2c7b0 [*]

org.apache.sling.commons.threads.impl.ThreadPoolFacade@0x125d2c798 [*]

org.apache.sling.commons.threads.impl.DefaultThreadPoolManager$Entry@0x125d535d0
 [*]
java.util.HashMap$Entry@0x125d535b0
[Ljava.util.HashMap$Entry;@0x124147940
java.util.HashMap@0x124147910

org.apache.sling.commons.threads.impl.DefaultThreadPoolManager@0x124146e50 [*]
org.apache.felix.framework.ServiceRegistrationImpl@0x12414f3e8
org.apache.sling.commons.threads.impl.Activator@0x12414f3d0 [*]
org.apache.felix.framework.BundleImpl@0x122809f78
org.apache.felix.framework.ServiceRegistrationImpl@0x1241e8c40
class org.apache.sling.commons.threads.impl.WebConsolePrinter

org.apache.sling.commons.threads.impl.WebConsolePrinter@0x1241e8a70 [*]
{noformat}

Logged SLING-3383 based on above. 

[1] https://gist.github.com/chetanmeh/8860776
[2] http://docs.oracle.com/javase/6/docs/technotes/tools/share/jhat.html

 Classloader Leak Detector Console Tab
 -

 Key: SLING-3359
 URL: https://issues.apache.org/jira/browse/SLING-3359
 Project: Sling
  Issue Type: New Feature
  Components: Console

[jira] [Commented] (SLING-3359) Classloader Leak Detector Console Tab

2014-02-05 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13893097#comment-13893097
 ] 

Chetan Mehrotra commented on SLING-3359:


Also opened enhancement bug FELIX-4418 to enable some support from framework in 
identifying such leaky classloaders while doing heap dump analysis

 Classloader Leak Detector Console Tab
 -

 Key: SLING-3359
 URL: https://issues.apache.org/jira/browse/SLING-3359
 Project: Sling
  Issue Type: New Feature
  Components: Console
Reporter: Ian Boston
Assignee: Chetan Mehrotra
 Attachments: 
 org.apache.sling.extensions.classloader-leak-detector-0.0.1-SNAPSHOT-src.zip


 Chetan has created a classloader leak detector console at 
 https://github.com/chetanmeh/sling-leak-detector. It would be really good to 
 get this into the contrib are and released so that consumers of Sling can use 
 it to locate code in bundles that is leaking classloaders.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3340) Warnings on startup regarding no-op loggers

2014-02-05 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13893099#comment-13893099
 ] 

Chetan Mehrotra commented on SLING-3340:


The bug has been fixed in Slf4j and a new release 1.7.6 with the fix is 
available [1]

[1] http://www.slf4j.org/news.html

 Warnings on startup regarding no-op loggers
 ---

 Key: SLING-3340
 URL: https://issues.apache.org/jira/browse/SLING-3340
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Depening on the order in which bundles are installed Slf4j might use NoOp 
 loggers for loggers created before Logback is initialized. One would see a 
 warning log like below
 {noformat}
 Slf4j is not initialized yet. Delaying Logback support initialization
 SLF4J: The following loggers will not work because they were created
 SLF4J: during the default configuration phase of the underlying logging 
 system.
 SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
 SLF4J: org.apache.sling.commons.logservice
 SLF4J: org.apache.sling.installer.core
 SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
 SLF4J: org.apache.sling.audit.osgi.installer
 SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
 SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
 SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
 SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
 SLF4J: org.apache.sling.installer.provider.file
 SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
 SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
 SLF4J: org.apache.sling.javax.activation
 SLF4J: org.apache.sling.javax.activation.internal.Activator
 SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
 SLF4J: org.apache.sling.launchpad.installer
 SLF4J: org.apache.sling.settings
 SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
 SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
 SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask
 {noformat}
 Given that log from Sling installer category are important and should not be 
 lost we should avoid such scenario to be created.
 See thread http://markmail.org/thread/n4zyj5akkh24ahh5



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [logging] warnings on startup regarding no-op loggers

2014-02-05 Thread Chetan Mehrotra
Just an update. The issue has now been fixed on Slf4j side and a new
release 1.7.6 was made which contains the fix. So this completes the
#3 approach mentioned previously.

With this there is just a small issue that while Slf4j is getting
initialized the log message would get lost as at that time NOP Loggers
are used. Once initialization is complete the log message from such
loggers would be handled in default way. To fix this we would need to
control the startup order and get the Commons Log bundle started
first.
Chetan Mehrotra


On Wed, Jan 29, 2014 at 4:47 PM, Chetan Mehrotra
chetan.mehro...@gmail.com wrote:
 On Wed, Jan 29, 2014 at 4:39 PM, Carsten Ziegeler cziege...@apache.org 
 wrote:
 never ever rely on that.
 Agreed. But ...

And for B we would need changes at least in the launchpad - for A we just
 fix slf4j
 Change in our code is in our control and easy to do without incurring
 any penalty. Fix in Slf4j might take time. So its like a workaround
 untill proper fix is done.

 Chetan Mehrotra


[jira] [Resolved] (SLING-3341) [logback] Race condition in configuring Logback

2014-02-03 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3341.


Resolution: Fixed

issue has not surfaced/reported again post this fix. Current fixes looks 
sufficient. Closing it for now

 [logback] Race condition in configuring Logback
 ---

 Key: SLING-3341
 URL: https://issues.apache.org/jira/browse/SLING-3341
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Current way to configure Logback works like as below
 1. Any change in config finally leads a call to 
 org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
 2. The config change is not done in concurrent way. A thread must acquire the 
 {{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
 it just sets a flag {{configChanged}} to true. The Logback reset job upon 
 completion checks {{configChanged}} . if found to be true then it reschedules 
 the job to load Logback again
 In current impl there is a small race condition where its possible that 
 Logback reset job does not see the {{configChanged}} flag and hence Logback 
 does not get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [osgi] Using Inventory API in Commons Log

2014-02-03 Thread Chetan Mehrotra
Thanks for the clarification Felix!

Just to confirm though ... if Inventory bundle is later
patched/refreshed it would then lead to refresh of Commons Log bundle
also. Would that mean framework would be bought down to level 1 and
restarted again
Chetan Mehrotra


On Mon, Feb 3, 2014 at 2:21 PM, Felix Meschberger fmesc...@adobe.com wrote:
 Hi

 Am 03.02.2014 um 09:41 schrieb Chetan Mehrotra chetan.mehro...@gmail.com:

 Hi,

 For SLING-3264 I was thinking to provide Inventory integration in
 Commons Logs. However the Commons Log bundle starts at level 1 while
 the Inventory bundle starts at Level 5. The log bundle would use the
 ServiceFactory approach to expose the Inventory service and would not
 have required dependency on Inventory API.

 So just wanted to confirm that would it be fine to depend on classes
 from a bundle which starts at later start level or not?

 Sure. This is what we are using ServiceFactory and dynamic/delayed import all 
 over places. See for example the Configuration Admin binding the Apache Felix 
 SCR bundle.

 So, what seems to boild down to kind of a best practice is to:

   * use ServiceFactory for optional services
   * use Import-Package with resolution:=optional to have
   static wiring if possible
   * use DynamicImport-Package to have dynamic wiring
   on-demand

 It is just very important to thouroughly test this to not get inadvertend 
 ClassNotFoundExceptions, for example if the optional classes appear in the 
 method signature of a required class (see the 
 ResourceResolverActivator.getFeaures() method which returns Object to work 
 around this issue).

 Regards
 Felix


Re: [osgi] Using Inventory API in Commons Log

2014-02-03 Thread Chetan Mehrotra
On Mon, Feb 3, 2014 at 2:54 PM, Felix Meschberger fmesc...@adobe.com wrote:
 So the question really is: what happens to the logger instances held by the 
 bundles 

Before answering that I need to confirm would a new classloader be
created for Commons Log upon package refresh? Probably yes then it
that case existing Logger instances would be referring to old
classloader. The other bundle would be bound to Sl4j API so they would
not be refreshed but there logger instances would be referring to
Logback provided classes.

So one should probably avoid external dependency for a bundle like Commons Log?

Chetan Mehrotra


Re: [osgi] Using Inventory API in Commons Log

2014-02-03 Thread Chetan Mehrotra
 Yes, that probably is the consequence and we should refrain from adding 
 Inventory API binding -- unless the commons log bundle exports the inventory 
 API itself

Well I required Inventory API to expose the logback state in JSON
format (not that strong requirement though). Currently WebConsole
supports Configuration Printer which do not explicitly implement
Inventory API i.e. it supports any class which provides a method like
[1] with some service properties. However that mode looks like does
not support json mode. If it can support that then there is no string
need for using Inventory API

public void printConfiguration(PrintWriter printWriter)
Chetan Mehrotra


On Mon, Feb 3, 2014 at 3:11 PM, Felix Meschberger fmesc...@adobe.com wrote:
 Hi

 Am 03.02.2014 um 10:30 schrieb Chetan Mehrotra chetan.mehro...@gmail.com:

 On Mon, Feb 3, 2014 at 2:54 PM, Felix Meschberger fmesc...@adobe.com wrote:
 So the question really is: what happens to the logger instances held by the 
 bundles 

 Before answering that I need to confirm would a new classloader be
 created for Commons Log upon package refresh? Probably yes then it
 that case existing Logger instances would be referring to old
 classloader. The other bundle would be bound to Sl4j API so they would
 not be refreshed but there logger instances would be referring to
 Logback provided classes.

 So one should probably avoid external dependency for a bundle like Commons 
 Log?

 Yes, that probably is the consequence and we should refrain from adding 
 Inventory API binding -- unless the commons log bundle exports the inventory 
 API itself...

 On the other hand: considering both the Inventory and the Web Console API to 
 be crucial, it might be conceivable to create API only bundles for these...

 Regards
 Felix


 Chetan Mehrotra



[jira] [Created] (SLING-3363) Make Logback status part of Configuration Printer output

2014-02-03 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3363:
--

 Summary: Make Logback status part of Configuration Printer output
 Key: SLING-3363
 URL: https://issues.apache.org/jira/browse/SLING-3363
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor


Sling Log Configuration Printer currently dump the content of various Log file 
as part of output. It would be good to have the Logback status also part of 
same output



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Resolved] (SLING-3363) Make Logback status part of Configuration Printer output

2014-02-03 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3363.


   Resolution: Fixed
Fix Version/s: Commons Log 4.0.0

Done with http://svn.apache.org/r1563820

 Make Logback status part of Configuration Printer output
 

 Key: SLING-3363
 URL: https://issues.apache.org/jira/browse/SLING-3363
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 Sling Log Configuration Printer currently dump the content of various Log 
 file as part of output. It would be good to have the Logback status also part 
 of same output



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [osgi] Using Inventory API in Commons Log

2014-02-03 Thread Chetan Mehrotra
On Mon, Feb 3, 2014 at 3:50 PM, Felix Meschberger fmesc...@adobe.com wrote:
 Well, officially, ConfigurationPrinter does not support JSON, but you can 
 write JSON as TXT output

I can ... but rendering JSON in TXT does not look pretty!!. Probably
it can be officially made to support json.


Chetan Mehrotra


[jira] [Created] (SLING-3364) All rotated log files are not made part of the zip provided through webconsole

2014-02-03 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3364:
--

 Summary: All rotated log files are not made part of the zip 
provided through webconsole
 Key: SLING-3364
 URL: https://issues.apache.org/jira/browse/SLING-3364
 Project: Sling
  Issue Type: Bug
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
 Fix For: Commons Log 4.0.0


Sling Log bundle so far provided ability to dump all the rotated log files as 
part of zip generated via Felix WebConsole support. With shift to Logback its 
not straightforward to  determine location of all rotated logs files e.g. one 
created via config xml 

Need to find a way to determine all such rotated log files and dump them. 

1. Dump all files from log folder
2. Dump only the file created via OSGi configuration as we know the pattern 
used and then use a logic similar to earlier version to determine all such 
files. For files generated by other appenders (one configured via xml) its not 
possible to determine the pattern post initialization



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [osgi] Using Inventory API in Commons Log

2014-02-03 Thread Chetan Mehrotra
On Mon, Feb 3, 2014 at 4:31 PM, Felix Meschberger fmesc...@adobe.com wrote:
 (Or semi-officially by just silently supporting it ?)

 Patches welcome.

Sure. Added that to ToDo list!!


Chetan Mehrotra


How to version packages exported from embedded bundles

2014-02-02 Thread Chetan Mehrotra
Hi,

I need some guidance around how to version packages which are exported
from embedded depedency. In case of Commons Log we are embedding
Logback jars. So far we were using version 1.0.13 and now we need to
switch to 1.1.0. However Logback (like most thirdparty jars) does not
follow OSGi semantic versioning guidelines and versions the packages
as per release number.

In most cases client of Commons Log would not have any API dependency
on the Logback unless they are providing custom Appenders

So far there has been no release of common log jar so we can safely
export the Logback packages at 1.1.0 version. But what should we do in
future

Some of the options I can think of

1. Do not export package with versions i.e. let it default to 0.0.0.
2. OR Keep a watch on changes and release it at versions which confirm
to OSGi Semantic Versioning guidelines
3.  Similar to #2 above but we then export packages twice. One as per version
 stated in Logback jar and another at version which confirms to #2
4. OR Let it export at release version and expect the client bundles to have
   a more relaxed import range for versions

Similar issue exist with Slf4j also

Chetan Mehrotra


[jira] [Commented] (SLING-3340) Warnings on startup regarding no-op loggers

2014-02-02 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13889254#comment-13889254
 ] 

Chetan Mehrotra commented on SLING-3340:


Opened bug in Slf4j [1] and sent a pull request for the possible fix [2]

[1] http://bugzilla.slf4j.org/show_bug.cgi?id=311
[2] https://github.com/qos-ch/slf4j/pull/58

 Warnings on startup regarding no-op loggers
 ---

 Key: SLING-3340
 URL: https://issues.apache.org/jira/browse/SLING-3340
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Depening on the order in which bundles are installed Slf4j might use NoOp 
 loggers for loggers created before Logback is initialized. One would see a 
 warning log like below
 {noformat}
 Slf4j is not initialized yet. Delaying Logback support initialization
 SLF4J: The following loggers will not work because they were created
 SLF4J: during the default configuration phase of the underlying logging 
 system.
 SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
 SLF4J: org.apache.sling.commons.logservice
 SLF4J: org.apache.sling.installer.core
 SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
 SLF4J: org.apache.sling.audit.osgi.installer
 SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
 SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
 SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
 SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
 SLF4J: org.apache.sling.installer.provider.file
 SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
 SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
 SLF4J: org.apache.sling.javax.activation
 SLF4J: org.apache.sling.javax.activation.internal.Activator
 SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
 SLF4J: org.apache.sling.launchpad.installer
 SLF4J: org.apache.sling.settings
 SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
 SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
 SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask
 {noformat}
 Given that log from Sling installer category are important and should not be 
 lost we should avoid such scenario to be created.
 See thread http://markmail.org/thread/n4zyj5akkh24ahh5



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: Classloader leaks ?

2014-01-31 Thread Chetan Mehrotra
Hi Ian,

I implemented the proposed approach in [1]. Can you give it a try and
let me know if it works for you.

Chetan Mehrotra
[1] https://github.com/chetanmeh/sling-leak-detector

On Wed, Jan 29, 2014 at 5:43 PM, Felix Meschberger fmesc...@adobe.com wrote:
 Hi

 Agreed, this sounds like an interesting approach to follow.

 Regards
 Felix

 Am 29.01.2014 um 12:21 schrieb Chetan Mehrotra chetan.mehro...@gmail.com:

 One possible approach can be that

 1. Have a custom bundle listener. This would maintain some structure
 around bundle
 2. Use Java Phantom reference [1] to register a callback for GC of
 classloader associated with the bundle. Upon gc callback we remove the
 information

 Then have a web console plugin which can look into the current data
 structure maintained by the listener. It would then check the state
 against actual active bundle and flag the suspects. And if left over a
 period of time can easly mark out stale bundles which are leaking.
 Should not incur any performance cost

 Chetan Mehrotra
 [1] 
 http://docs.oracle.com/javase/7/docs/api/java/lang/ref/PhantomReference.html



[jira] [Created] (SLING-3360) Bundle to detect classloader leaks

2014-01-31 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3360:
--

 Summary: Bundle to detect classloader leaks
 Key: SLING-3360
 URL: https://issues.apache.org/jira/browse/SLING-3360
 Project: Sling
  Issue Type: New Feature
  Components: Extensions
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra


At times it can happen that bundle might leak classloader due to improper 
cleanup. This was recently discussed on DL [1].

To enable detection of such bundles we can have a bundle which 
1. Have a custom bundle listener. This would maintain some structure
around bundle
2. Use Java Phantom reference [1] to register a callback for GC of
classloader associated with the bundle. Upon gc callback we remove the
information

Then have a web console plugin which can look into the current data
structure maintained by the listener. It would then check the state
against actual active bundle and flag the suspects. And if left over a
period of time can easly mark out stale bundles which are leaking.
Should not incur any performance cost

[1] http://sling.markmail.org/thread/2wg7ijus6ib7ij5t




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3359) Classloader Leak Detector Console Tab

2014-01-31 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13887675#comment-13887675
 ] 

Chetan Mehrotra commented on SLING-3359:


Done the import and initial commit in http://svn.apache.org/r1563112. Read the 
readme for more details

 Classloader Leak Detector Console Tab
 -

 Key: SLING-3359
 URL: https://issues.apache.org/jira/browse/SLING-3359
 Project: Sling
  Issue Type: New Feature
  Components: Console
Reporter: Ian Boston
Assignee: Chetan Mehrotra
 Attachments: 
 org.apache.sling.extensions.classloader-leak-detector-0.0.1-SNAPSHOT-src.zip


 Chetan has created a classloader leak detector console at 
 https://github.com/chetanmeh/sling-leak-detector. It would be really good to 
 get this into the contrib are and released so that consumers of Sling can use 
 it to locate code in bundles that is leaking classloaders.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [logging] warnings on startup regarding no-op loggers

2014-01-29 Thread Chetan Mehrotra
Any comments ... which approach to take?
Chetan Mehrotra


On Sat, Jan 25, 2014 at 12:59 PM, Chetan Mehrotra
chetan.mehro...@gmail.com wrote:
 Yes such a situation might occur. Some approaches I can think of are

 1. Special case Log bundles when installing bundle in
 BootstrapInstaller. So in the installBundle call [2] we would have to
 add some kind of sorting such that Slf4j related bundles get started
 first *before* any other bundle is started. Currently the order of
 start of bundles at start level 1 is not deterministic.

 2. Similar to above. But instead of special casing using specific file
 name we rely on custom Bundle header. So instead of ordering in
 installBundle we sort the bundle list in startBundle call based on the
 custom header. To support that we add a custom header
 'x-sling-startup-order' in common log. This would ensure that commons
 log bundle is started first.

 3. This would require change in Slf4j. Currently Slf4j returns a NoOp
 logger [4] in substitution phase. It maintains the list of logger
 names. Instead of that if it returned some kind of substitute logger
 which internally used a delegate (which defaults to NoOp). Later when
 log system is initialized then it can replace the delegate with actual
 logger implementations.

 Such a situation was faced in SLING-3189 [3] as well but then we
 worked around it and avoided adding startup order.

 Created SLING-3340 [1] for the same.

 Chetan Mehrotra
 [1] https://issues.apache.org/jira/browse/SLING-3340
 [2] 
 https://github.com/apache/sling/blob/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java#L410-L414
 [3] https://issues.apache.org/jira/browse/SLING-3189
 [4] 
 https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java

 On Fri, Jan 24, 2014 at 10:39 PM, Justin Edelson
 jus...@justinedelson.com wrote:
 On launchpad startup, I see this warning message:
 Slf4j is not initialized yet. Delaying Logback support initialization
 SLF4J: The following loggers will not work because they were created
 SLF4J: during the default configuration phase of the underlying logging 
 system.
 SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
 SLF4J: org.apache.sling.commons.logservice
 SLF4J: org.apache.sling.installer.core
 SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
 SLF4J: org.apache.sling.audit.osgi.installer
 SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
 SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
 SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
 SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
 SLF4J: org.apache.sling.installer.provider.file
 SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
 SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
 SLF4J: org.apache.sling.javax.activation
 SLF4J: org.apache.sling.javax.activation.internal.Activator
 SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
 SLF4J: org.apache.sling.launchpad.installer
 SLF4J: org.apache.sling.settings
 SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
 SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
 SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask

 Based on http://www.slf4j.org/codes.html#substituteLogger, this seems
 problematic. I'm especially concerned about the installer loggers
 being non functional.

 Is my understanding correct?

 Thanks,
 Justin


[jira] [Commented] (SLING-3344) log bundle is too conservative in exporting logback

2014-01-29 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13885143#comment-13885143
 ] 

Chetan Mehrotra commented on SLING-3344:


While we are at it ... should we export all packages from Logback. At starting 
I only exported those packages which were like defining the API. Probably we 
should export all.

Thoughts?

 log bundle is too conservative in exporting logback
 ---

 Key: SLING-3344
 URL: https://issues.apache.org/jira/browse/SLING-3344
 Project: Sling
  Issue Type: Bug
  Components: Commons
Reporter: Justin Edelson
Assignee: Justin Edelson
 Fix For: Commons Log 4.0.0


 In trying to deploy a logback appender provided by a cloud logging provider, 
 I found that there are several packages which are not exported by Commons 
 Log, namely ch.qos.logback.classic.encoder and 
 ch.qos.logback.classic.pattern*.
 These should be exported by Commons Log.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [logging] warnings on startup regarding no-op loggers

2014-01-29 Thread Chetan Mehrotra
On Wed, Jan 29, 2014 at 3:24 PM, Carsten Ziegeler cziege...@apache.org wrote:
 I would prefer 3 if feasible/doable in a short time frame.

Seeing the slow release cycle of Slf4j API it might take some time to
push for such change and get a release done. I would start a
discussion on there DL.

For now, all bundles in the boot level get the same start level.
Ideally yes only the log bundle and framework fragment bundle start at
level 1 and rest are moved to 2. However I was not sure about the
impact of changing startlevel on upgrade hence suggested #2

So can we go for #2?

Chetan Mehrotra
Chetan Mehrotra


On Wed, Jan 29, 2014 at 3:27 PM, Carsten Ziegeler cziege...@apache.org wrote:
 So an ugly option would be to have:
 startLevel level=boot
 log bundles
 /startlevel
 startLevel level=boot:2
   everything else
 /startLevel

 Carsten


 2014-01-29 Carsten Ziegeler cziege...@apache.org

 I would prefer 3 if feasible/doable in a short time frame.

 The other option I see would be to enhance our launchpad support and allow
 for different start levels for both, the bootstrap installer and the osgi
 installer. For now, all bundles in the boot level get the same start
 level. Unfortunately our XML is not that flexible :(

 Carsten


 2014-01-29 Chetan Mehrotra chetan.mehro...@gmail.com

 Any comments ... which approach to take?
 Chetan Mehrotra


 On Sat, Jan 25, 2014 at 12:59 PM, Chetan Mehrotra
 chetan.mehro...@gmail.com wrote:
  Yes such a situation might occur. Some approaches I can think of are
 
  1. Special case Log bundles when installing bundle in
  BootstrapInstaller. So in the installBundle call [2] we would have to
  add some kind of sorting such that Slf4j related bundles get started
  first *before* any other bundle is started. Currently the order of
  start of bundles at start level 1 is not deterministic.
 
  2. Similar to above. But instead of special casing using specific file
  name we rely on custom Bundle header. So instead of ordering in
  installBundle we sort the bundle list in startBundle call based on the
  custom header. To support that we add a custom header
  'x-sling-startup-order' in common log. This would ensure that commons
  log bundle is started first.
 
  3. This would require change in Slf4j. Currently Slf4j returns a NoOp
  logger [4] in substitution phase. It maintains the list of logger
  names. Instead of that if it returned some kind of substitute logger
  which internally used a delegate (which defaults to NoOp). Later when
  log system is initialized then it can replace the delegate with actual
  logger implementations.
 
  Such a situation was faced in SLING-3189 [3] as well but then we
  worked around it and avoided adding startup order.
 
  Created SLING-3340 [1] for the same.
 
  Chetan Mehrotra
  [1] https://issues.apache.org/jira/browse/SLING-3340
  [2]
 https://github.com/apache/sling/blob/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java#L410-L414
  [3] https://issues.apache.org/jira/browse/SLING-3189
  [4]
 https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java
 
  On Fri, Jan 24, 2014 at 10:39 PM, Justin Edelson
  jus...@justinedelson.com wrote:
  On launchpad startup, I see this warning message:
  Slf4j is not initialized yet. Delaying Logback support initialization
  SLF4J: The following loggers will not work because they were created
  SLF4J: during the default configuration phase of the underlying
 logging system.
  SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
  SLF4J: org.apache.sling.commons.logservice
  SLF4J: org.apache.sling.installer.core
  SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
  SLF4J: org.apache.sling.audit.osgi.installer
  SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
  SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
  SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
  SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
  SLF4J: org.apache.sling.installer.provider.file
  SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
  SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
  SLF4J: org.apache.sling.javax.activation
  SLF4J: org.apache.sling.javax.activation.internal.Activator
  SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
  SLF4J: org.apache.sling.launchpad.installer
  SLF4J: org.apache.sling.settings
  SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
  SLF4J:
 org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
  SLF4J:
 org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask
 
  Based on http://www.slf4j.org/codes.html#substituteLogger, this seems
  problematic. I'm especially concerned about the installer loggers
  being non functional.
 
  Is my understanding correct?
 
  Thanks,
  Justin




 --
 Carsten Ziegeler
 cziege

Re: [logging] warnings on startup regarding no-op loggers

2014-01-29 Thread Chetan Mehrotra
 on the next startup the bundles will again start in an
 unpredictable order, if they have the same start level.

Aah .. I misread the code. I thought Sling starts the bundle always
though that code path. Missed the facts that such a flow is only used
for new bundles.

 Chetan, do you see a possible workaround that would allow us
 to wait for the necessary slf4j releases

There are couple of approaches again then

A - We create issue on Slf4j and initiate a discussion. This might
take time. Given that Slf4j is MIT licensed [1] we can create our
custom wrapper with the fix and use that in our distributions

B - We rely on fact (implementation detail) that Felix *does* start
bundle in same order in the way they were installed [2]. We go for
approach #2 I mentioned previously. And as and when Slf4j is fixed we
use that


Chetan Mehrotra
[1] http://slf4j.org/license.html
[2] 
https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873


Re: [logging] warnings on startup regarding no-op loggers

2014-01-29 Thread Chetan Mehrotra
On Wed, Jan 29, 2014 at 4:39 PM, Carsten Ziegeler cziege...@apache.org wrote:
 never ever rely on that.
Agreed. But ...

And for B we would need changes at least in the launchpad - for A we just
fix slf4j
Change in our code is in our control and easy to do without incurring
any penalty. Fix in Slf4j might take time. So its like a workaround
untill proper fix is done.

Chetan Mehrotra


[jira] [Commented] (SLING-3341) [logback] Race condition in configuring Logback

2014-01-28 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13883913#comment-13883913
 ] 

Chetan Mehrotra commented on SLING-3341:


Fixed another race condition in http://svn.apache.org/r1562003

In this case there was a race condition when logbackManager is initialized. It 
can happen that OSGi config events are received while the started flag is set 
to false and config has been invoked

 [logback] Race condition in configuring Logback
 ---

 Key: SLING-3341
 URL: https://issues.apache.org/jira/browse/SLING-3341
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Current way to configure Logback works like as below
 1. Any change in config finally leads a call to 
 org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
 2. The config change is not done in concurrent way. A thread must acquire the 
 {{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
 it just sets a flag {{configChanged}} to true. The Logback reset job upon 
 completion checks {{configChanged}} . if found to be true then it reschedules 
 the job to load Logback again
 In current impl there is a small race condition where its possible that 
 Logback reset job does not see the {{configChanged}} flag and hence Logback 
 does not get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3341) [logback] Race condition in configuring Logback

2014-01-27 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3341:
--

 Summary: [logback] Race condition in configuring Logback
 Key: SLING-3341
 URL: https://issues.apache.org/jira/browse/SLING-3341
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra


Current way to configure Logback works like as below

# Any change in config finally leads a call to 
org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
# The config change is not done in concurrent way. A thread must acquire the 
{{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
it just sets a flag {{configChanged}} to true. The Logback reset job upon 
completion checks {{configChanged}} . if found to be true then it reschedules 
the job to load Logback again

In current impl there is a small race condition where its possible that Logback 
reset job does not see the {{configChanged}} flag and hence Logback does not 
get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Updated] (SLING-3341) [logback] Race condition in configuring Logback

2014-01-27 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra updated SLING-3341:
---

Description: 
Current way to configure Logback works like as below

1. Any change in config finally leads a call to 
org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged

2. The config change is not done in concurrent way. A thread must acquire the 
{{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
it just sets a flag {{configChanged}} to true. The Logback reset job upon 
completion checks {{configChanged}} . if found to be true then it reschedules 
the job to load Logback again

In current impl there is a small race condition where its possible that Logback 
reset job does not see the {{configChanged}} flag and hence Logback does not 
get reinitialized and is configured with stale config

  was:
Current way to configure Logback works like as below

# Any change in config finally leads a call to 
org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
# The config change is not done in concurrent way. A thread must acquire the 
{{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
it just sets a flag {{configChanged}} to true. The Logback reset job upon 
completion checks {{configChanged}} . if found to be true then it reschedules 
the job to load Logback again

In current impl there is a small race condition where its possible that Logback 
reset job does not see the {{configChanged}} flag and hence Logback does not 
get reinitialized and is configured with stale config


 [logback] Race condition in configuring Logback
 ---

 Key: SLING-3341
 URL: https://issues.apache.org/jira/browse/SLING-3341
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Current way to configure Logback works like as below
 1. Any change in config finally leads a call to 
 org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
 2. The config change is not done in concurrent way. A thread must acquire the 
 {{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
 it just sets a flag {{configChanged}} to true. The Logback reset job upon 
 completion checks {{configChanged}} . if found to be true then it reschedules 
 the job to load Logback again
 In current impl there is a small race condition where its possible that 
 Logback reset job does not see the {{configChanged}} flag and hence Logback 
 does not get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (SLING-3341) [logback] Race condition in configuring Logback

2014-01-27 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13882801#comment-13882801
 ] 

Chetan Mehrotra commented on SLING-3341:


Refactored the logic in http://svn.apache.org/r1561666

 [logback] Race condition in configuring Logback
 ---

 Key: SLING-3341
 URL: https://issues.apache.org/jira/browse/SLING-3341
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra

 Current way to configure Logback works like as below
 1. Any change in config finally leads a call to 
 org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
 2. The config change is not done in concurrent way. A thread must acquire the 
 {{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then 
 it just sets a flag {{configChanged}} to true. The Logback reset job upon 
 completion checks {{configChanged}} . if found to be true then it reschedules 
 the job to load Logback again
 In current impl there is a small race condition where its possible that 
 Logback reset job does not see the {{configChanged}} flag and hence Logback 
 does not get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Created] (SLING-3340) Warnings on startup regarding no-op loggers

2014-01-24 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3340:
--

 Summary: Warnings on startup regarding no-op loggers
 Key: SLING-3340
 URL: https://issues.apache.org/jira/browse/SLING-3340
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra


Depening on the order in which bundles are installed Slf4j might use NoOp 
loggers for loggers created before Logback is initialized. One would see a 
warning log like below

{noformat}
Slf4j is not initialized yet. Delaying Logback support initialization
SLF4J: The following loggers will not work because they were created
SLF4J: during the default configuration phase of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
SLF4J: org.apache.sling.commons.logservice
SLF4J: org.apache.sling.installer.core
SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
SLF4J: org.apache.sling.audit.osgi.installer
SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
SLF4J: org.apache.sling.installer.provider.file
SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
SLF4J: org.apache.sling.javax.activation
SLF4J: org.apache.sling.javax.activation.internal.Activator
SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
SLF4J: org.apache.sling.launchpad.installer
SLF4J: org.apache.sling.settings
SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask
{noformat}

Given that log from Sling installer category are important and should not be 
lost we should avoid such scenario to be created.

See thread http://markmail.org/thread/n4zyj5akkh24ahh5



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


Re: [logging] warnings on startup regarding no-op loggers

2014-01-24 Thread Chetan Mehrotra
Yes such a situation might occur. Some approaches I can think of are

1. Special case Log bundles when installing bundle in
BootstrapInstaller. So in the installBundle call [2] we would have to
add some kind of sorting such that Slf4j related bundles get started
first *before* any other bundle is started. Currently the order of
start of bundles at start level 1 is not deterministic.

2. Similar to above. But instead of special casing using specific file
name we rely on custom Bundle header. So instead of ordering in
installBundle we sort the bundle list in startBundle call based on the
custom header. To support that we add a custom header
'x-sling-startup-order' in common log. This would ensure that commons
log bundle is started first.

3. This would require change in Slf4j. Currently Slf4j returns a NoOp
logger [4] in substitution phase. It maintains the list of logger
names. Instead of that if it returned some kind of substitute logger
which internally used a delegate (which defaults to NoOp). Later when
log system is initialized then it can replace the delegate with actual
logger implementations.

Such a situation was faced in SLING-3189 [3] as well but then we
worked around it and avoided adding startup order.

Created SLING-3340 [1] for the same.

Chetan Mehrotra
[1] https://issues.apache.org/jira/browse/SLING-3340
[2] 
https://github.com/apache/sling/blob/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java#L410-L414
[3] https://issues.apache.org/jira/browse/SLING-3189
[4] 
https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/helpers/SubstituteLoggerFactory.java

On Fri, Jan 24, 2014 at 10:39 PM, Justin Edelson
jus...@justinedelson.com wrote:
 On launchpad startup, I see this warning message:
 Slf4j is not initialized yet. Delaying Logback support initialization
 SLF4J: The following loggers will not work because they were created
 SLF4J: during the default configuration phase of the underlying logging 
 system.
 SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger
 SLF4J: org.apache.sling.commons.logservice
 SLF4J: org.apache.sling.installer.core
 SLF4J: org.apache.sling.installer.core.impl.OsgiInstallerImpl
 SLF4J: org.apache.sling.audit.osgi.installer
 SLF4J: org.apache.sling.installer.core.impl.PersistentResourceList
 SLF4J: org.apache.sling.installer.core.impl.EntityResourceList
 SLF4J: org.apache.sling.installer.core.impl.tasks.BundleTaskCreator
 SLF4J: org.apache.sling.installer.core.impl.DefaultTransformer
 SLF4J: org.apache.sling.installer.provider.file
 SLF4J: org.apache.sling.installer.provider.file.impl.ServicesListener
 SLF4J: org.apache.sling.installer.provider.file.impl.FileInstaller
 SLF4J: org.apache.sling.javax.activation
 SLF4J: org.apache.sling.javax.activation.internal.Activator
 SLF4J: org.apache.sling.javax.activation.internal.OsgiMailcapCommandMap
 SLF4J: org.apache.sling.launchpad.installer
 SLF4J: org.apache.sling.settings
 SLF4J: org.apache.sling.settings.impl.SlingSettingsServiceImpl
 SLF4J: org.apache.sling.launchpad.installer.impl.LaunchpadConfigInstaller
 SLF4J: org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask

 Based on http://www.slf4j.org/codes.html#substituteLogger, this seems
 problematic. I'm especially concerned about the installer loggers
 being non functional.

 Is my understanding correct?

 Thanks,
 Justin


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

2014-01-22 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-3049:


I need to rework the pull request. However the problem is (as explained in my 
last comment above) this feature is tricky to implement in OSGi env. So better 
to disable it for now. So its bit low priority now

 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
 Fix For: Commons Log 4.0.0

 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.1.5#6160)


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

2014-01-22 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3049.


   Resolution: Won't Fix
Fix Version/s: (was: Commons Log 4.0.0)

Resolving as Won't Fix for now given the issue in supporting such a feature in 
OSGi env. If later need arises for same and we have a working solution we can 
enable it

 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.1.5#6160)


Re: [ANN] Welcome Tommaso Teofili as a Sling committer!

2014-01-14 Thread Chetan Mehrotra
Welcome Tommaso!!
Chetan Mehrotra


On Tue, Jan 14, 2014 at 7:56 PM, Tommaso Teofili
tommaso.teof...@gmail.com wrote:
 Thanks a lot to the whole Sling PMC for your trust, I look forward to keep
 working and having fun in Sling.

 Regards,
 Tommaso


 2014/1/14 Bertrand Delacretaz bdelacre...@apache.org

 Hi,

 Based on his ongoing and valuable contributions, the Apache Sling
 Project Management Committee (PMC) has voted to invite Tommaso as a
 Sling committer, and he has accepted the invitation.

 According to http://people.apache.org/committer-index.html that makes
 him a committer in *eleven* Apache projects, along with being an ASF
 member an Incubator PMC member.

 Thanks Tommaso for your good contributions, keep up the good work!

 -Bertrand



Re: Trusted credentials and loginByService

2014-01-13 Thread Chetan Mehrotra
1a and 1b would enable us to sandbox scripts and would be quite a good
feature to have. This would allows us to have a much better Multi
Tennant support story.

However the problem with sandboxing untrusted code in any form
requires quite a bit of an effort. Just to start with

a. Disable access to Java reflection API
b. Limit access to OSGi service registry
c. Limit access to JMX. You can invoke OSGi Framework API via JMX Beans!

... there would be lot more other aspects that needs to be considered.

Doing this would certainly require a SecurityManager. And adding that
after a system has evolved would require quite an effort as Ian
mentioned. Further you always have a chance that such sandboxed
scripts can hog system resources (endless while loop!) thus effecting
other parts of the system. While some language like Groovy provide
some support [1] to enable running scripts in a sandbox. Its still
hard to say that its fully sandboxed.

So even if its possible theoretically to sandbox code in JVM it would
be too much an effort to support that. And then also there would be
possibilities of system checks getting bypassed due to
vulnerabilities. Hence supporting 1 or 1a, 1b, 1c in any form would
not be possible practically.

 2. 3rd party app bundles

I would say this falls in #1 and cannot be supported in a sure shot manner.

Chetan Mehrotra
[1] http://groovy-sandbox.kohsuke.org/


On Tue, Jan 14, 2014 at 3:56 AM, Alexander Klimetschek
aklim...@adobe.com wrote:
 Right, good analysis! I have further important additions to #1 and #2:

 #1 of course is difficult. It should be split up:
 -

 1a. malicious JSP/script code

 Injecting a script that gets executed by Sling can be a lot easier (incorrect 
 ACLs on production systems) than deploying a bundle (which should only 
 possible with admin). This is definitely a goal that Sling should have: that 
 you can make sure scripts can be fully sandboxed.

 There are 2 important separations: access to java APIs and - since it is core 
 to Sling - access to the resources / jcr. The first should be possible by 
 just whitelisting APIs a script can use (e.g. no System.exit()) while the 
 latter requires a fully safe authentication mechanism that is handled on the 
 jcr side.

 1b. malicious bundles reading from JCR through the API

 Even if a bundle could be installed, IMO it is not clear that it should have 
 access to the data in the resource tree (JCR). A service user mapping config 
 _could_ in theory be implemented safely so that you cannot circumvent it 
 through Java code (that's what I was refering to in my original mail). This 
 would make the JCR safe (ignoring the issue of reading the repo via the file 
 system or reloading the repo bundle).

 1c. malicious bundles in general

 Of course, if an attacker can install bundles, he could do:
 - malicious code: things like System.exit(), endless loops
 - access critical infra services (OSGi admins, crypto service etc.)
 - try to read osgi config data from the filesystem
 - try to read the repository data directly through the filesystem (i.e. using 
 a customized jackrabbit bundle without authentication)

 Ignoring how much work it would be in the end, solutions that IMO are at 
 least possible:
 - a new OSGi sandboxing, so that they cannot import all packages/classes, 
 but just a subset (e.g. no System.*; a simpler way than JaaS); to avoid 
 permission management hell for normal product development, you'd only do this 
 in production with a seal now button, so that permissions are restricted 
 only for newly added (malicious) bundles
 - similarly, disable file system permissions through JaaS, as a whitelist on 
 a production system (configured in the filesystem and not through a web UI 
 provided by Sling itself, or at least not with a replaceable bundle, so you 
 couldn't hack the configuration)
 - remember, the JCR access was protected already through safe authentication; 
 no need for making the jcr packages invisible or inventing a JaaS permission, 
 as JCR already has an auth mechanism


 With 1b and 1c in place, even a malicious bundle could not steal arbitrary 
 data from the repository (unless exposed by other services through an API, 
 internally using a loginByService() with a more powerful user; which in most 
 cases is wrong; note that all other code would be implicitly using the 
 request session).

 If you say it's impossible it will be a self-fulfilling prophecy: you add 
 new stuff that doesn't care about the clear boundaries, and then it is indeed 
 impossible to find a way to shield things from each other. Before you can 
 think about using JaaS, you have to have clear APIs and boundaries, so that 
 permissions are simple and obvious and not too complex.


 Also, there is an important case for #2:
 -

 2. 3rd party app bundles

 Running 3rd party apps on a multi-tenant Sling instance, managed

Re: Trusted credentials and loginByService

2014-01-12 Thread Chetan Mehrotra
Before we add more support to secure access to trusted authentication
we need to have a practical view of attack vectors

1. Secure against malicious code
--

Here we assume that there is some malicious code/bundle running within
the OSGi container and we need to secure access to trusted auth
feature such that it cannot be abused. If this is the case then there
is no way we can secure against it. The std means for running such non
trusted code in same VM is to use Security manager. It would be
similar to how Applets are executed within Browser JVM process. IMHO
adding a security manager now would not be possible at all as it needs
to be factored in from starting.

Any other means of securing the access is bound to fail as one can
resort to reflection to invoke any hidden api.

2. Prevent misuses due to programmer error


Here we assume that a person using this feature has not thought
through the implications of using such a feature. Further looking at
system we do not get an idea on where all this feature is being used
by. Currently it requires a manual inspection of code. Here having a
formal method as proposed in wiki [1] should help as it would force
users of this feature to to think and enable one to determine where
all it is being used

3. Prevent privilege escalation by an external user
-

Here we assume that an attacker is accessing the Sling system via its
web interface. It needs to be ensured that an attacker is not able to
escalate the account via manipulating the request parameters. So an
authentication handler has to ensure that it does not populate the
AuthenticationInfo in a generic way from request parameters i.e.
converting parameter map to authentication info attributes. Such usage
would anyway be limited and can be defended against via code review of
authentication handlers which are limited in numbers

So we can aim for #2 and #3 and provide support for that. Going for #1
is not possible for a system like Sling

Chetan Mehrotra
[1] 
https://cwiki.apache.org/confluence/display/SLING/Solving+the+Authentication+Handler+Credential+Validation+Problem#SolvingtheAuthenticationHandlerCredentialValidationProblem-PreventingPrivilegeEscalation

On Sat, Jan 11, 2014 at 7:44 AM, Alexander Klimetschek
aklim...@adobe.com wrote:
 Regarding:
 https://issues.apache.org/jira/browse/SLING-3179
 https://cwiki.apache.org/confluence/display/SLING/Solving+the+Authentication+Handler+Credential+Validation+Problem

 I don't see how this is adding security other than reintroducing the 
 TrustedInfo again, just with different and more complex code.

 What I would like to see is reusing the whitelist-configurable 
 loginByService() approach here: an authentication handler with pre 
 authentication would loginByService() + impersonation – the user configured 
 for the service would need to be able to impersonate into all the desired 
 users, e.g. the admin user (but it would be an external config that admins 
 can control in production).

 But there is some more involved - some of this is from a f2f discussion with 
 Felix and Tobi:

 # Auth Handler loginByService issue

 This is difficult, since the call stack is not direct - the auth handler does 
 not call loginByService directly but rather passes authinfo to the sling 
 authenticator who does the loginByService, so the service check would see the 
 wrong service.

 # Pushing loginByService down to the repo

 But IMHO the service check belongs into the repository bundle, not the 
 jcrresourceresolver in sling. A new OakRepository replacing SlingRepository 
 as an extra Oak service should provide the loginByService() (and no 
 loginAdministrative() anymore to make a clean cut) and would live inside the 
 private repository space, able to access oak's inner auth mechanisms to login 
 as any user.

 # Big picture and goals

 This way there is a clear boundary between application/sling side and the 
 repository. To control repository access for all code, not just certain areas 
 such as JSP scripts, assuming the hacker can install bundles or trick people 
 into doing so or simply a broken bundle in production that exposes a security 
 risk and should be quickly disabled (revoking user mapping).

 With this boundary, you couldn't hack the system by adding a custom 
 jcrresourceresolver service allowing any logins. For this btw, any other 
 trusted login trick into JCR must be disabled (not sure if the Subject.doAs 
 is prone to that). The only thing you could do is to replace the entire 
 repository bundle - but there should be a way to make that fruitless.

 # loginByService can still be circumvented

 And importantly, the loginByService() check can be circumvented if you can 
 get the bundle context / service reference from another service that has a 
 loginByService user mapping. There should be a way to make that safe:

 - It might involve some OSGi extension. However, their answer would likely be 
 JaaS, which we want

Re: [replication] Whiteboard pattern for replication events?

2014-01-08 Thread Chetan Mehrotra
I think the requirement here are subset of what is required in
SLING-3292[1]. So should be addressed with proper Web Hook support in
Sling

[1] https://issues.apache.org/jira/browse/SLING-3292
Chetan Mehrotra


On Wed, Jan 8, 2014 at 3:26 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 Hi Marius,

 On Wed, Jan 8, 2014 at 10:49 AM, Marius Petria mpet...@adobe.com wrote:
 ...The intended patch for SLING-3309 is generic, meaning that it just allows
 customization of the HTTP payload...

 Ok, I guess you need to show us that patch then ;-)

 -Bertrand


[jira] [Commented] (SLING-3309) Allow flushing of external caching systems

2014-01-08 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13865337#comment-13865337
 ] 

Chetan Mehrotra commented on SLING-3309:


Probably the requirement here can be met via SLING-3292

 Allow flushing of external caching systems
 --

 Key: SLING-3309
 URL: https://issues.apache.org/jira/browse/SLING-3309
 Project: Sling
  Issue Type: Improvement
  Components: Extensions
Reporter: Marius Petria
  Labels: replication
 Attachments: SLING-3309.patch


 Allow signaling over HTTP to external caching systems that a content 
 hierarchy has changed.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


DynamicClassLoader usage and best practices

2014-01-07 Thread Chetan Mehrotra
Hi,

Sling provides support for DynamicClassLoaderManager which is used by
various bundle which need to instantiate classes from string class
names in OSGi env. As per current logic the DynamicClassLoaderManager
service factory would be unregistered and re registered if any of the
bundle state changes from which classes were loaded by *any* of the
DynamicClassLoaders

This causes quite a bit of churn in re deployments of bundles whose
classes are used within scripts. As services in all bundles which make
use of DynamicClassLoaderManager get reinitialized as typically
services haves a static reference to DynamicClassLoaderManager.

Such a churn can be avoided if we only unregister the service used by
those bundles whose DynamicClassloaders have used classes from bundle
whose state got changed. Can such an approach be used or we need to
unbind DynamicClassLoaderManager for all users on every change?

Chetan Mehrotra
[1] 
http://sling.apache.org/apidocs/sling6/org/apache/sling/commons/classloader/DynamicClassLoaderManager.html
[2] 
https://github.com/apache/sling/blob/trunk/bundles/commons/classloader/src/main/java/org/apache/sling/commons/classloader/impl/Activator.java#L110-L127


[jira] [Resolved] (SLING-3251) Enable Logback ChangeLevelDispatcher by default if JUL Integration is enabled

2013-12-15 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3251.


   Resolution: Fixed
Fix Version/s: Commons Log 4.0.0

Added support in http://svn.apache.org/r1551120

With this Commons Log would install a {{LevelChangePropagator}} automatically 
if it detects that Slf4j Bridge Handler has to be enabled. This should make use 
of this feature more performant as otherwise  a bit of performance degradation 
would be observed for JUL logging [1]

[1] http://logback.qos.ch/manual/configuration.html#LevelChangePropagator

 Enable Logback ChangeLevelDispatcher by default if JUL Integration is enabled
 -

 Key: SLING-3251
 URL: https://issues.apache.org/jira/browse/SLING-3251
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0


 With Logback its possible to use ChangeLevelDispatcher [1] to minimize the 
 performance impact. Currently one needs to explicitly enable in logback.xml 
 via
 {code:xml}
 configuration
   contextListener class=ch.qos.logback.classic.jul.LevelChangePropagator/
 /configuration
 {code}
 It would be better if Logback Integration logic adds this listener on its own 
 if the {{org.apache.sling.commons.log.julenabled}} is set to true without 
 requiring explicit user effort to tweak Logback xml config
 [1] http://logback.qos.ch/manual/configuration.html#LevelChangePropagator



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)


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

2013-12-13 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra commented on SLING-3049:


With [1550694|http://svn.apache.org/r1550694] I have disabled support for 
PackagingDataCalculator all together. The way it computes PackagingData would 
cause issue in OSGi environment. Also the support we had required a locally 
modified file of Logback and which with its EPL licences would anyway have to 
be removed.

So with this disabled we should not see this issue. Later if Logback does 
include the fix for LOGBACK-899 users can still enable it as suggested in 
SLING-3257. Leaving it open for now, once it is confirmed that above issue is 
not seen anymore would close the bug as WontFix 

 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
 Fix For: Commons Log 4.0.0

 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.1.4#6159)


[jira] [Commented] (SLING-3275) Add Buffered Logging Configuration in Apache Sling Logging Logger

2013-12-10 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13844096#comment-13844096
 ] 

Chetan Mehrotra commented on SLING-3275:


Yes by default it would be disabled and would highlight the concern in help 
message

 Add Buffered Logging Configuration in Apache Sling Logging Logger
 ---

 Key: SLING-3275
 URL: https://issues.apache.org/jira/browse/SLING-3275
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 4.0.0
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra
Priority: Minor

 Logback supports buffered logging [1]. As of now it can be used directly by 
 configuring the appender via Logback xml file [2]. To simplify its usage we 
 should expose a config as part of OSGi config
 [1] http://logback.qos.ch/manual/encoders.html#immediateFlush
 [2] 
 http://sling.apache.org/documentation/development/logging.html#wzxhzdk13wzxhzdk14configuring-osgi-appenders-in-the-logback-config



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)


[jira] [Resolved] (SLING-2897) [LOG] Enhance web console plugin with edit feature

2013-12-03 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-2897.


   Resolution: Fixed
Fix Version/s: Commons Log 4.0.0

Applied a modified patch with http://svn.apache.org/r1547417

For now the JSON support was not included. If a need arises we can add support 
for json later. 

This feature makes tweaking log settings very easy!! 

 [LOG] Enhance web console plugin with edit feature
 --

 Key: SLING-2897
 URL: https://issues.apache.org/jira/browse/SLING-2897
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 3.0.0
Reporter: Bjoern Weide
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0

 Attachments: org.apache.sling.commons.log.patch, 
 org.apache.sling.commons.log.patch


 The current web console plugin only lists the configured loggers but links 
 for the actual configuration to the OSGi Configuration Manager. 
 It should be improved so the logging configuration can be edited in the web 
 console plugin directly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Created] (SLING-3264) Integrate with Felix Inventory Support in Commons Log

2013-12-03 Thread Chetan Mehrotra (JIRA)
Chetan Mehrotra created SLING-3264:
--

 Summary: Integrate with Felix Inventory Support in Commons Log 
 Key: SLING-3264
 URL: https://issues.apache.org/jira/browse/SLING-3264
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Chetan Mehrotra
Assignee: Chetan Mehrotra


The Commons Log expose some information as part of Configuration Printer. For 
better support it should also integrate with Felix Inventory Feature [1] and 
expose the internal runtime state.

Also it might be better to decouple dumping of Log file content. So it should 
expose two printers. One to provide log file details and other to provide the 
runtime state information

[1] 
http://felix.apache.org/documentation/subprojects/apache-felix-inventory.html



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (SLING-2897) [LOG] Enhance web console plugin with edit feature

2013-12-03 Thread Chetan Mehrotra (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-2897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13838566#comment-13838566
 ] 

Chetan Mehrotra commented on SLING-2897:


bq. The json support covers the special use case of a headless operation. 
With this change it is now possible to control the logger configuration via 
HTTP, so you could add/edit/remove loggers using curl. We found this useful in 
environments where you cannot access the web console via browser. Since edit  
remove requires the logger pid a json output of the current config would make 
it easier to get it.

Makes sense. I would prefer to expose the required information as part of 
[Felix Inventory 
Support|http://felix.apache.org/documentation/subprojects/apache-felix-inventory.html]
 which has a json rendering mode. I have created SLING-3264 for the same. Would 
that work for you?

 [LOG] Enhance web console plugin with edit feature
 --

 Key: SLING-2897
 URL: https://issues.apache.org/jira/browse/SLING-2897
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Affects Versions: Commons Log 3.0.0
Reporter: Bjoern Weide
Assignee: Chetan Mehrotra
Priority: Minor
 Fix For: Commons Log 4.0.0

 Attachments: org.apache.sling.commons.log.patch, 
 org.apache.sling.commons.log.patch


 The current web console plugin only lists the configured loggers but links 
 for the actual configuration to the OSGi Configuration Manager. 
 It should be improved so the logging configuration can be edited in the web 
 console plugin directly.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Resolved] (SLING-3258) [regression] Sling log support webconsole no longer links to logger configurations

2013-11-29 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3258.


   Resolution: Fixed
Fix Version/s: Commons Log 4.0.0

Added support in  http://svn.apache.org/r1546580

 [regression] Sling log support webconsole no longer links to logger 
 configurations
 --

 Key: SLING-3258
 URL: https://issues.apache.org/jira/browse/SLING-3258
 Project: Sling
  Issue Type: Bug
  Components: Commons
Reporter: Alexander Klimetschek
Assignee: Chetan Mehrotra
Priority: Minor
  Labels: logback
 Fix For: Commons Log 4.0.0


 The log support webconsole used to link to each logger configuration (the 
 osgi configuration web console view). This is a useful feature to quickly 
 find the right loggers and change log levels etc. and should be added back.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Resolved] (SLING-3257) Make logback packaging data in stacktraces configurable

2013-11-29 Thread Chetan Mehrotra (JIRA)

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

Chetan Mehrotra resolved SLING-3257.


   Resolution: Fixed
Fix Version/s: Commons Log 4.0.0

Added support in http://svn.apache.org/r1546601. A new property 
{{org.apache.sling.commons.log.packagingDataEnabled}} is exposed as part of Log 
Config Manager config

 Make logback packaging data in stacktraces configurable
 ---

 Key: SLING-3257
 URL: https://issues.apache.org/jira/browse/SLING-3257
 Project: Sling
  Issue Type: Improvement
  Components: Commons
Reporter: Alexander Klimetschek
Assignee: Chetan Mehrotra
Priority: Minor
  Labels: logback
 Fix For: Commons Log 4.0.0


 The logback packaging information in stacktraces that was added with 
 SLING-3049 should be configurable, i.e. it should be possible to turn it on 
 or off.
 Some stacktrace parsers (IDEs etc.) might not be able to parse it and it can 
 make traces harder to read, so it should IMO be an optional feature.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


<    4   5   6   7   8   9   10   11   >