Skip to content

Conversation

ferblaca
Copy link
Contributor

Resolves #3004

This pull request includes changes to the DefaultBinderFactory class to improve thread safety by introducing a ReentrantLock. The most important changes include adding the lock, modifying the getBinder method to use the lock, and ensuring the lock is released properly.

Thread safety improvements:

…erFactory class for virtual-threads

The getBinder method in DefaultBinderFactory was made thread-safe using ReentrantLock. This commit ensures that the method is friendly for virtual threads to avoid blocking and pinning. The lock is acquired at the beginning of the method and released in a finally block to ensure it is always released, even if an exception occurs. Fixes spring-cloudgh-3004
@olegz olegz merged commit eecec41 into spring-cloud:main Sep 24, 2024
1 check passed
@olegz olegz added this to the 4.2.0-M2 milestone Sep 24, 2024
@ferblaca ferblaca deleted the GH-3004 branch September 26, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Idea] Changing the use of synchronized in the getBinder method of DefaultBinderFactory class for virtual threads
2 participants