+
Skip to content

DefaultLazyLoader is not thread safe, but is used in a shared instance of CachedRealm #40531

@ahus1

Description

@ahus1

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

infinispan

Describe the bug

Instances of CachedRealm are stored in the local cache of each Keycloak instance and then accessed concurrently.

Those instances then hold instances of DefaultLazyLoader which needs to be thread safe as it is accessed from multiple threads concurrently

Version

main

Regression

  • The issue is a regression

Expected behavior

Classes accessed from multiple threads should be thread safe.

This class explicitly states that it is not. This is possibly not doing harm, still it leads to concurrently loading data in parallel threads, which can and should be avoided to prevent a stampede.

Actual behavior

Code states it is not thread safe, but is accessed from multiple threads in parallel

How to Reproduce?

Code review of CachedRealm and DefaultLazyLoader

Anything else?

I'll create a PR

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载