aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Antinori (JIRA)" <>
Subject [jira] [Commented] (ARIES-1732) blueprint-cm - race condition
Date Thu, 03 Aug 2017 09:24:00 GMT


Paolo Antinori commented on ARIES-1732:

I am statically reviewing the code and I don't think to see a direct link with ConfigAdmin
service presence.

The main issues were tied to the writing of {{CmPropertyPlaceholder.initialized}} that in
the unhappy path scenario, was already set to {{true}}, even if an initial call to {{updated()}}
was sending around a null Dictionary object, happening in the cases when ConfigAdmin thread
kicks in too early.

As far as I can see, {{initialized}} is a private property of {{CmPropertyPlaceholder}}, so,
not impacting any superclass, and it's used only in the context of the update method here:

    public void updated(Dictionary props) {
        LOGGER.debug("Invoking updated() with properties {}", props);
        if (!initialized && props != null) {
            LOGGER.debug("Initializing properties");
            properties = props;
            initialized = true;

I don't see anything risking to block or to skip any lifecycle step.

> blueprint-cm - race condition
> -----------------------------
>                 Key: ARIES-1732
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Paolo Antinori
> There is a possible race condition in ``
and ``
> There are situations where `ConfigAdmin` service might not be available and returns `null`
when queried for the initial `config`.
> In other cases instead, `CmPropertyPlaceholder` receives updates from `ConfigAdmin` thread
even before it has completed it's initialization.
> The code doesn't discriminate if `config` is `null` or not, and treats any value as valid,
marking `CmPropertyPlaceholder` instance as initialized.
> This leads to spotty errors.
> The suggested fix, that simply prevents that `update(null)` invocation mark the `CmPropertyPlaceholder`
instance as initialized, addresses the issue.
> Code here:

This message was sent by Atlassian JIRA

View raw message