Skip to content

AbstractApplicationEventMulticaster#getApplicationListeners() should have double check for 'this.retrieverCache.get(cacheKey)' within synchronized block [SPR-10351] #14985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Mar 4, 2013 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 4, 2013

Artem Bilan opened SPR-10351 and commented

In the multi-threaded publishing events environment AbstractApplicationEventMulticaster#supportsEvent() may be invoked twice (or more) for the same event type: from first Thread, who builds cache entry in the synchronized block, and from second (and so on), who is waiting synchronization monitor.


Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

We opted for a different tradeoff back in Spring Framework 3.2 GA already: We keep the locks as short as possible, accepting the potential for concurrent creation of cache entries in order to optimize for high-load scenarios with a pre-populated cache. Have a look at the latest code there.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Artem Bilan commented

Thanks, Juergen, I got it.
Of course, I can live with recreating the same cache entry in the multi-threaded environment, because it is still here.
However, it sounds like LockRegistry may have value here: https://jira.springsource.org/browse/INT-2909.
WDYT?

@spring-projects-issues spring-projects-issues added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants