Skip to content

FELIX-6891: Filter indices must not get the tracked services - #611

Open
pderop wants to merge 1 commit into
apache:masterfrom
pderop:FELIX-6891
Open

pderop wants to merge 1 commit into
apache:masterfrom
pderop:FELIX-6891

Conversation

@pderop

@pderop pderop commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Motivation:

The multi-property, aspect and adapter filter indices track all services and called BundleContext.getService() on each of them, although they only index service references. This activates lazy services (SCR delayed components, service factories) as soon as they are registered, and keeps their usage count positive.

Modification:

The indices now track the ServiceReference itself and no longer get the service object. A unit test verifies that getService() is never called.

Result:

Enabling a filter index no longer changes the lifecycle of lazy services.

Motivation:

The multi-property, aspect and adapter filter indices track all services
and called BundleContext.getService() on each of them, although they only
index service references. This activates lazy services (SCR delayed
components, service factories) as soon as they are registered, and keeps
their usage count positive.

Modification:

The indices now track the ServiceReference itself and no longer get the
service object. A unit test verifies that getService() is never called.

Result:

Enabling a filter index no longer changes the lifecycle of lazy services.
@pderop pderop self-assigned this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant