Skip to content
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

Deadlock may occure when Openfeign works with deferred JPA repository #443

Closed
michaldo opened this issue Dec 14, 2020 · 3 comments
Closed
Assignees

Comments

@michaldo
Copy link
Contributor

Spring Cloud version "Hoxton.SR9"

Under some condition deadlock happens with Openfeign + deferred JPA repository. I can reproduce the case only in tests.

I created a simple project to reproduce the problem: https://github.com/michaldo/feign-jpa-deffered-deadlock

I think the same case is reported on https://stackoverflow.com/questions/65078382/spring-boot-context-load-test-hangs

I guess the reason is that FeignClientFactoryBean does not extend AbstractFactoryBean

@OlgaMaciaszek
Copy link
Collaborator

OlgaMaciaszek commented Jan 20, 2021

@michaldo Thanks for reporting this.

Further analysis:
From here new child context is being created, which triggers ContextRefreshedEvent. DataSourceInitializedPublisher listens on this event and tries to get dataSourceInitialization future. This is causing a deadlock.
dataSourceIniitialization is being initialized within the postProcessEntityManagerFactory method.

@OlgaMaciaszek
Copy link
Collaborator

The problem seems to be in Spring Boot. Have created spring-projects/spring-boot#24966. Also, upgrading to Boot 2.3.7 should help as the deferred mode was set to non-default (spring-projects/spring-boot#24249).
Closing in favour of the Spring Boot issues.

@michaldo
Copy link
Contributor Author

Initially Spring Boot guys told it is OpenFeing issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants