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

Antonio Sanso commented on FELIX-4863:
--------------------------------------

Root cause
The implementation of the SSLFilter (mostly in HttpServiceTracker) has a 
classic multithreading race condition.
As soon as the bundle gets started, both the “addingService” and “updated” 
method are called asynchronously.
If “updated” hits line 124 before “addingService” hits line 109, then no 
configuration will be applied (the default will be applied, no matter what the 
actual configuration is).
If ”addingService” hits line 109 before “updated” hits line 124, then the 
correct configuration will be applied (this is the expected behavior).

How to reproduce?
 
Set debug points on entry of these 2 methods:
org.apache.felix.http.sslfilter.internal.HttpServiceTracker.addingService (line 
99)
org.apache.felix.http.sslfilter.internal.HttpServiceTracker.open 
(ManagedService.updated) (line 71)

> SSLFilter 0.1.0 and 0.2.0 have a Java race condition, stopping the Filter 
> from working correctly
> ------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-4863
>                 URL: https://issues.apache.org/jira/browse/FELIX-4863
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>            Reporter: Antonio Sanso
>
> There is a Java race condition, where if the wrong method "wins", the 
> configuration does not get applied.
> The SSL Filter (which is supposed to override certain Request/Response 
> methods) does not work, causing mapping failures, wrong URLs, etc.



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

Reply via email to