You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Charles Moulliard <ch...@gmail.com> on 2015/06/05 09:51:51 UTC

Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Hi,

Could it be possible with Apache Karaf 2.4 that, when we have a huge number
of threads accessing JAAS Properties login Module, some thread could be
blocked/locked as we reopen every time the users.properties file (
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60)
?

Regards,
-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Charles Moulliard <ch...@gmail.com>.
Hi,

Please find here the zip file containing the Threads blocked/locked -
https://www.dropbox.com/s/y94x550v1neiksf/cxf-jaas-issue-june-2015-ThreadDump.zip?dl=0
As you will see, the thread blocks here - see
(org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.initialize(PropertiesLoginModule.java:59)
:

1) Thread blocked
"qtp1871095807-403" prio=10 tid=0x00007faa2400a800 nid=0x19a7c waiting
for monitor entry [0x00007fab8f3f2000]
     java.lang.Thread.State: BLOCKED (on object monitor)
      at
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.serviceChanged(LocalRepositoryImpl.java:75)
      - waiting to lock <0x000000074278bae8> (a
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl)

2) Thread Locked (0x000000074278bae8)
"qtp1871095807-392" prio=10 tid=0x00007faa38562800 nid=0x167d7 runnable
[0x00007fab04cca000]
     java.lang.Thread.State: RUNNABLE
      at java.lang.String.intern(Native Method)
      at
org.apache.felix.bundlerepository.impl.CapabilityImpl.setName(CapabilityImpl.java:57)
      at
org.apache.felix.bundlerepository.impl.LocalResourceImpl.convertExportServiceToCapability(LocalResourceImpl.java:142)
      at
org.apache.felix.bundlerepository.impl.LocalResourceImpl.initialize(LocalResourceImpl.java:66)
      at
org.apache.felix.bundlerepository.impl.LocalResourceImpl.<init>(LocalResourceImpl.java:39)
      at
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.addBundle(LocalRepositoryImpl.java:98)
      at
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.serviceChanged(LocalRepositoryImpl.java:76)
      - locked <0x000000074278bae8> (a
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl)
      at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:934)
      at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:795)
      at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)
      at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4666)
      at org.apache.felix.framework.Felix.registerService(Felix.java:3674)
      at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:347)
      at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:320)
      at
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.initialize(PropertiesLoginModule.java:59)
      at
org.apache.karaf.jaas.boot.ProxyLoginModule.initialize(ProxyLoginModule.java:76)
      at sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at
javax.security.auth.login.LoginContext.invoke(LoginContext.java:771)
      at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
      at java.security.AccessController.doPrivileged(Native Method)
      at
javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
      at
org.apache.cxf.interceptor.security.JAASLoginInterceptor.handleMessage(JAASLoginInterceptor.java:139)
      at
org.apache.cxf.jaxrs.security.JAASAuthenticationFilter.handleRequest(JAASAuthenticationFilter.java:99)
      at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:208)
      at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:90)
      at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)

Regards,

Charles

On Fri, Jun 5, 2015 at 10:25 AM, Morgan Hautman <mo...@gmail.com>
wrote:

> Maybe we first need to be sure that it is the problem?
>
> Regards
> Morgan
>
>
> On 5/06/2015 10:20, Christian Schneider wrote:
>
>> I agree that loading the file each time does not scale well. As the
>> property files are mostly static I propose we install
>> a listener for changes and cache the contents in a thread safe map
>> internally.
>>
>> WDYT?
>>
>> Christian
>>
>> On 05.06.2015 09:51, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> Could it be possible with Apache Karaf 2.4 that, when we have a huge
>>> number
>>> of threads accessing JAAS Properties login Module, some thread could be
>>> blocked/locked as we reopen every time the users.properties file (
>>>
>>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60)
>>>
>>> ?
>>>
>>> Regards,
>>>
>>
>>
>>
>


-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Morgan Hautman <mo...@gmail.com>.
Maybe we first need to be sure that it is the problem?

Regards
Morgan

On 5/06/2015 10:20, Christian Schneider wrote:
> I agree that loading the file each time does not scale well. As the 
> property files are mostly static I propose we install
> a listener for changes and cache the contents in a thread safe map 
> internally.
>
> WDYT?
>
> Christian
>
> On 05.06.2015 09:51, Charles Moulliard wrote:
>> Hi,
>>
>> Could it be possible with Apache Karaf 2.4 that, when we have a huge 
>> number
>> of threads accessing JAAS Properties login Module, some thread could be
>> blocked/locked as we reopen every time the users.properties file (
>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60) 
>>
>> ?
>>
>> Regards,
>
>


Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Christian Schneider <ch...@die-schneider.net>.
I agree that loading the file each time does not scale well. As the 
property files are mostly static I propose we install
a listener for changes and cache the contents in a thread safe map 
internally.

WDYT?

Christian

On 05.06.2015 09:51, Charles Moulliard wrote:
> Hi,
>
> Could it be possible with Apache Karaf 2.4 that, when we have a huge number
> of threads accessing JAAS Properties login Module, some thread could be
> blocked/locked as we reopen every time the users.properties file (
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60)
> ?
>
> Regards,


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Morgan Hautman <mo...@gmail.com>.
Hi Charles,

I think this could be possible.
The use of 
https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html 
is made for multi-threaded environments accessing files.

Regards,
Morgan

On 5/06/2015 9:51, Charles Moulliard wrote:
> Hi,
>
> Could it be possible with Apache Karaf 2.4 that, when we have a huge number
> of threads accessing JAAS Properties login Module, some thread could be
> blocked/locked as we reopen every time the users.properties file (
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60)
> ?
>
> Regards,


Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It would be great to have a threadDump to investigate ;)

Regards
JB

On 06/05/2015 10:18 AM, Charles Moulliard wrote:
> I don't have the threadDump (get this issue from a client). I don't think
> that encryption was used.
>
> On Fri, Jun 5, 2015 at 10:10 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> Hi Charles,
>>
>> Did you take a thread dump ? Especially did you enable the encryption ?
>>
>> Regards
>> JB
>>
>>
>> On 06/05/2015 09:51 AM, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> Could it be possible with Apache Karaf 2.4 that, when we have a huge
>>> number
>>> of threads accessing JAAS Properties login Module, some thread could be
>>> blocked/locked as we reopen every time the users.properties file (
>>>
>>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60
>>> )
>>> ?
>>>
>>> Regards,
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Charles Moulliard <ch...@gmail.com>.
I don't have the threadDump (get this issue from a client). I don't think
that encryption was used.

On Fri, Jun 5, 2015 at 10:10 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> Hi Charles,
>
> Did you take a thread dump ? Especially did you enable the encryption ?
>
> Regards
> JB
>
>
> On 06/05/2015 09:51 AM, Charles Moulliard wrote:
>
>> Hi,
>>
>> Could it be possible with Apache Karaf 2.4 that, when we have a huge
>> number
>> of threads accessing JAAS Properties login Module, some thread could be
>> blocked/locked as we reopen every time the users.properties file (
>>
>> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60
>> )
>> ?
>>
>> Regards,
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Re: Thread locked with JAASLogin Module called by CXF Interceptor (Karaf 2.4)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Charles,

Did you take a thread dump ? Especially did you enable the encryption ?

Regards
JB

On 06/05/2015 09:51 AM, Charles Moulliard wrote:
> Hi,
>
> Could it be possible with Apache Karaf 2.4 that, when we have a huge number
> of threads accessing JAAS Properties login Module, some thread could be
> blocked/locked as we reopen every time the users.properties file (
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.karaf.jaas/org.apache.karaf.jaas.modules/2.3.4/org/apache/karaf/jaas/modules/properties/PropertiesLoginModule.java?av=f#60)
> ?
>
> Regards,
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com