opentracing-contrib / opentracing-contrib/java-spring-cloud

Adding spring-data-starter-data-jpa with ddl-auto=update causes block at startup

Open
#285 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
399
Forks
143
Avg merge
1d 3h
Merged PRs (30d)
22

Description

I had posted this issue to wavefront-spring-boot project, but it was identified that there was an issue with Open Tracing. See issue https://github.com/wavefrontHQ/wavefront-spring-boot/issues/27

When I choose to do jpa.hibernate.ddl-auto=update then I get a deadlock during initialization.

I have this dependency included.

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-spring-cloud-starter</artifactId>
    <version>0.5.3</version>
</dependency>

Per Stephane.

That's an issue when the EntityManager is bootstrapped asynchronously and OpenTracing is used. If I remove the open tracing starter, the application runs fine.

In the meantime, you can force the bootstrap of JPA in the same thread by adding the following to application.properties:

spring.data.jpa.repositories.bootstrap-mode=default
It looks like opentracing is wrapping the DataSource too aggressively as the proxy contains an aspect that hasn't been initialized yet.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the opentracing-spring-cloud-starter dependency and the EntityManager asynchronous bootstrap path described in the report. Compare startup with ddl-auto=update and with spring.data.jpa.repositories.bootstrap-mode=default, then trace the DataSource proxy initialization; done means JPA starts without a deadlock while OpenTracing remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.