You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Filippo Diotalevi <fi...@gmail.com> on 2009/09/16 14:53:01 UTC
Any race condition in Felix 1.8 service lookup you are aware of?
Hi,
I'm experiencing a weird (and not easily reproducible) behavior with
my Spring DM + Felix application, that counts quite a lot (>50) of
Spring DM bundles.
What's happening is that an instance of the wrong type gets injected
in a Spring managed bean. In particular, a service retrieved with a
simple
<osgi:reference id="xmlproxy" interface="com.acme.api.XmlProxy"
filter="(&(APPLICATION=SL)(COUNTRY=UK))" />
and injected in a Spring bean turns out to be a totally different
service, with the same filter (&(APPLICATION=SL)(COUNTRY=UK)), but
obviously with a different interface (service name).
I'm using Felix 1.8.0... are you aware of any race condition in that
version with service lookup?
Unfortunately is quite difficult to reproduce the error, so I don't
have a simple test case.
--
Filippo Diotalevi
Re: Any race condition in Felix 1.8 service lookup you are aware of?
Posted by Toni Menzel <to...@okidokiteam.com>.
I recall there was an issue related to startup ordering of spring dm bundles
and its participants back when we added the profile on pax tools. Just
wanted to point to this, don't have binding material or jira issues at hand
right now.Will point to it when i found something.
Toni
On Wed, Sep 16, 2009 at 7:37 PM, Filippo Diotalevi <
filippo.diotalevi@gmail.com> wrote:
> On Wed, Sep 16, 2009 at 5:16 PM, Richard S. Hall <he...@ungoverned.org>
> wrote:
> > Are you saying you do not experience this in Felix 2.0.0?
> >
> > If so, we didn't address anything specific in this area.
>
> I haven't tried with 2.0, since the problem is very difficult to
> reproduce (we actually experience it just in one machine, that we
> cannot access easily).
> However, I tried today a simple home made load testing (100+ threads
> trying to concurrently get a reference to some appearing/disappearing
> services) and both 1.8.0 and 2.0.0 showed no issues.
>
> The only clue so far is that "services -u <pid>" in the console
> clearly shows that Spring DM has injected a wrong service reference in
> a Spring bean. I'll try to continue my investigation on the Spring
> side.
>
>
> --
> Filippo Diotalevi
>
--
Toni Menzel
Independent Software Developer
Professional Profile: http://okidokiteam.com
toni@okidokiteam.com
http://www.ops4j.org - New Energy for OSS Communities - Open
Participation Software.
Re: Any race condition in Felix 1.8 service lookup you are aware of?
Posted by Filippo Diotalevi <fi...@gmail.com>.
On Wed, Sep 16, 2009 at 5:16 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> Are you saying you do not experience this in Felix 2.0.0?
>
> If so, we didn't address anything specific in this area.
I haven't tried with 2.0, since the problem is very difficult to
reproduce (we actually experience it just in one machine, that we
cannot access easily).
However, I tried today a simple home made load testing (100+ threads
trying to concurrently get a reference to some appearing/disappearing
services) and both 1.8.0 and 2.0.0 showed no issues.
The only clue so far is that "services -u <pid>" in the console
clearly shows that Spring DM has injected a wrong service reference in
a Spring bean. I'll try to continue my investigation on the Spring
side.
--
Filippo Diotalevi
Re: Any race condition in Felix 1.8 service lookup you are aware
of?
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Are you saying you do not experience this in Felix 2.0.0?
If so, we didn't address anything specific in this area.
-> richard
On 9/16/09 14:53, Filippo Diotalevi wrote:
> Hi,
> I'm experiencing a weird (and not easily reproducible) behavior with
> my Spring DM + Felix application, that counts quite a lot (>50) of
> Spring DM bundles.
>
> What's happening is that an instance of the wrong type gets injected
> in a Spring managed bean. In particular, a service retrieved with a
> simple
>
> <osgi:reference id="xmlproxy" interface="com.acme.api.XmlProxy"
> filter="(&(APPLICATION=SL)(COUNTRY=UK))" />
>
> and injected in a Spring bean turns out to be a totally different
> service, with the same filter (&(APPLICATION=SL)(COUNTRY=UK)), but
> obviously with a different interface (service name).
>
> I'm using Felix 1.8.0... are you aware of any race condition in that
> version with service lookup?
>
> Unfortunately is quite difficult to reproduce the error, so I don't
> have a simple test case.
>
>
Re: Any race condition in Felix 1.8 service lookup you are aware of?
Posted by Karl Pauls <ka...@gmail.com>.
On Wed, Sep 16, 2009 at 2:53 PM, Filippo Diotalevi
<fi...@gmail.com> wrote:
> Hi,
> I'm experiencing a weird (and not easily reproducible) behavior with
> my Spring DM + Felix application, that counts quite a lot (>50) of
> Spring DM bundles.
>
> What's happening is that an instance of the wrong type gets injected
> in a Spring managed bean. In particular, a service retrieved with a
> simple
>
> <osgi:reference id="xmlproxy" interface="com.acme.api.XmlProxy"
> filter="(&(APPLICATION=SL)(COUNTRY=UK))" />
>
> and injected in a Spring bean turns out to be a totally different
> service, with the same filter (&(APPLICATION=SL)(COUNTRY=UK)), but
> obviously with a different interface (service name).
>
> I'm using Felix 1.8.0... are you aware of any race condition in that
> version with service lookup?
We did improve our locking in 2.0.0 a lot but I can't say I remember a
race condition in service handling per say (but it might be catched by
the other improvements as they are in the area of classloading).
regards,
Karl
> Unfortunately is quite difficult to reproduce the error, so I don't
> have a simple test case.
>
> --
> Filippo Diotalevi
>
--
Karl Pauls
karlpauls@gmail.com