Skip to content

FELIX-6885: Fix stale entries in auto-configured Collection/Map fields - #605

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

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

Conversation

@pderop

@pderop pderop commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Motivation:

When a component loses a required dependency but its instance is kept (one of its dependencies needs the instance, the default for a ConfigurationDependency), its auto-configured Collection/Map fields are not cleaned. On restart, the services are copied again on top of the old content: the fields contain services that are gone, and duplicates.

Modification:

When the component goes back to waiting for required dependencies and keeps its instance, ComponentImpl removes the injected services from the auto-configured fields. They are injected again when the component restarts. A unit test reproduces the scenarios.

Result:

On restart, auto-configured Collection/Map fields only contain the currently available services, each one once.

Motivation:

When a component loses a required dependency but its instance is kept (one
of its dependencies needs the instance, the default for a
ConfigurationDependency), its auto-configured Collection/Map fields are not
cleaned. On restart, the services are copied again on top of the old
content: the fields contain services that are gone, and duplicates.

Modification:

When the component goes back to waiting for required dependencies and keeps
its instance, ComponentImpl removes the injected services from the
auto-configured fields. They are injected again when the component restarts.
A unit test reproduces the scenarios.

Result:

On restart, auto-configured Collection/Map fields only contain the currently
available services, each one once.
@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