Skip to content

CachedIntrospectionResults Not Thread Safe [SPR-9584] #14218

Closed
@spring-projects-issues

Description

@spring-projects-issues

elliot barlas opened SPR-9584 and commented

My Spring web application invokes org.springframework.beans.BeanUtils.getPropertyDescriptors in a multi-threaded context. After recent code refactoring, I started noticing something strange: the call occasionally returns an incomplete set of property descriptors. The code change must have produced paths that randomly execute getPropertyDescriptors at exactly the same time. I have written a targeted Java app to demonstrate the problem.

Attached is Main.java, a simple Java app that lines up threads and then invokes getPropertyDescriptors in parallel.

The beans are modeled after my application beans.

When I run the app continuously, failures eventually occur:
for i in {1..1000}; do java -cp <jar path> test.Main 50; done
Fail: 8
Fail: 3
Fail: 8
...

I haven't yet taken the time to identify the thread-safety issue.


Affects: 3.1 GA

Attachments:

Issue Links:

Referenced from: commits spring-attic/spring-framework-issues@96899fe, spring-attic/spring-framework-issues@16d97dc

2 votes, 3 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions