felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Bosschaert (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FELIX-5199) Race condition in HttpServiceFactory.getService() causing exception
Date Thu, 25 Feb 2016 18:36:18 GMT

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

David Bosschaert updated FELIX-5199:
------------------------------------
    Attachment: felix-5199.patch

The attached small patch fixes the issue. It would be great if someone could review that I
didn't miss anything.

> Race condition in HttpServiceFactory.getService() causing exception
> -------------------------------------------------------------------
>
>                 Key: FELIX-5199
>                 URL: https://issues.apache.org/jira/browse/FELIX-5199
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http.base-3.0.6
>            Reporter: David Bosschaert
>            Assignee: David Bosschaert
>         Attachments: felix-5199.patch
>
>
> The HttpServiceFactory.getService() is as follows:
> {code}
>     public HttpService getService(final Bundle bundle, final ServiceRegistration<HttpService>
reg)
>     {
>         final ServletContext servletContext = this.context;
>         if ( servletContext != null ) {
>             return new PerBundleHttpServiceImpl(bundle,
>                     this.sharedHttpService,
>                     this.context,
>                     this.contextAttributeListenerManager,
>                     this.sharedContextAttributes,
>                     this.requestListenerManager,
>                     this.requestAttributeListenerManager);
>         }
>         return null;
>     }{code}
> However it is possible that this.context is set to {{null}} after the check for {{null}}
is done but before the constructor is called causing a null servlet context to be passed to
{{PerBundleHttpServiceImpl}}



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

Mime
View raw message