Description
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:
- Main.java (1005 bytes)
- One.java (253 bytes)
- Three.java (440 bytes)
- Two.java (848 bytes)
Issue Links:
- Overhaul non-void JavaBean write method support [SPR-10029] #14663 Overhaul non-void JavaBean write method support
Referenced from: commits spring-attic/spring-framework-issues@96899fe, spring-attic/spring-framework-issues@16d97dc
2 votes, 3 watchers