KEMBAR78
Change "synchronized" to reentrant lock for virtual-threads by omercelikceng · Pull Request #1188 · spring-cloud/spring-cloud-function · GitHub
Skip to content

Conversation

@omercelikceng
Copy link
Contributor

initialize method in AzureWebProxyInvoker class
initialize method in AzureFunctionInstanceInjector class
initialize method in FunctionInvoker class
addDispatchHandler and dispatch methods in ServerlessAsyncContext class
INSTANCE method in JsonMasker class
memoize method in FunctionLookupHelper class

were 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.

@olegz olegz merged commit f637b98 into spring-cloud:main Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants