Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Potential race condition in PluginTenantConfigurableConfigurationHandler #100

Copy link
Copy link
@steven-barnes

Description

@steven-barnes
Issue body actions

This code uses the double-checked lock pattern:

    public C getConfigurable(@Nullable final UUID kbTenantId) {
        if (kbTenantId != null && !this.configuredTenants.contains(kbTenantId)) {
            synchronized(this.configuredTenants) {
                if (!this.configuredTenants.contains(kbTenantId)) {
                    this.configure(kbTenantId);
                    this.configuredTenants.add(kbTenantId);
                }
            }
        }

        return (C)this.pluginTenantConfigurable.get(kbTenantId);
    }

However configuredTenants can potentially be modified by a different thread while contains is called out side the synchronization block. AFAIK, this is not thread safe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.