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

JDBC Opentracing Regression on 1.3.0.CR1 #7695

Closed
bcluap opened this issue Mar 9, 2020 · 9 comments
Closed

JDBC Opentracing Regression on 1.3.0.CR1 #7695

bcluap opened this issue Mar 9, 2020 · 9 comments
Assignees
Labels
kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@bcluap
Copy link

bcluap commented Mar 9, 2020

Describe the bug
"Unable to acquire JDBC Connection" when turning on JDBC opentracing

Expected behavior
JDBC can connect and tracing events are sent

Actual behavior
Errors are thrown and JPA fails completely:

: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1539)
at org.hibernate.query.Query.getResultList(Query.java:165)
at guru.jini.arch.impl.persistence.WrappedQuery.getResultList(WrappedQuery.java:93)
at guru.jini.arch.impl.persistence.WrappedQuery.getResultList(WrappedQuery.java:84)
at guru.jini.arch.impl.persistence.JpaImpl.getResultList(JpaImpl.java:488)
at guru.jini.arch.impl.persistence.JpaImpl.getResultList(JpaImpl.java:324)
at guru.jini.arch.impl.persistence.JpaImpl_ClientProxy.getResultList(JpaImpl_ClientProxy.zig:487)
at guru.jini.services.wallet.dao.Dao.getAllRateConfigs(Dao.java:496)
at guru.jini.services.wallet.rating.impl.bestprefix.BestPrefixRatingEngine.refresh(BestPrefixRatingEngine.java:196)
at guru.jini.services.wallet.rating.impl.bestprefix.BestPrefixRatingEngine.lambda$init$0(BestPrefixRatingEngine.java:60)
at guru.jini.arch.impl.thread.NamedRunnable.run(NamedRunnable.java:40)
at guru.jini.arch.impl.thread.WrappedScheduledFuture.lambda$new$2(WrappedScheduledFuture.java:82)
at guru.jini.arch.impl.thread.NamedRunnable.run(NamedRunnable.java:40)
at guru.jini.arch.impl.thread.RequestContextActivator.runInRequestContext(RequestContextActivator.java:52)
at guru.jini.arch.impl.thread.RequestContextActivator_Subclass.runInRequestContext$$superaccessor323(RequestContextActivator_Subclass.zig:24)
at guru.jini.arch.impl.thread.RequestContextActivator_Subclass$$function$$323.apply(RequestContextActivator_Subclass$$function$$323.zig:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54)
at io.quarkus.arc.impl.ActivateRequestContextInterceptor.aroundInvoke(ActivateRequestContextInterceptor.java:24)
at io.quarkus.arc.impl.ActivateRequestContextInterceptor_Bean.intercept(ActivateRequestContextInterceptor_Bean.zig:65)
at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41)
at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
at guru.jini.arch.impl.thread.RequestContextActivator_Subclass.runInRequestContext(RequestContextActivator_Subclass.zig:330)
at guru.jini.arch.impl.thread.RequestContextActivator_ClientProxy.runInRequestContext(RequestContextActivator_ClientProxy.zig:232)
at guru.jini.arch.impl.thread.WrappedExecutorService.lambda$surroundWithRequestScoped$0(WrappedExecutorService.java:143)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:107)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:134)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:50)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:151)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2104)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2034)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2012)
at org.hibernate.loader.Loader.doQuery(Loader.java:953)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
at org.hibernate.loader.Loader.doList(Loader.java:2838)
at org.hibernate.loader.Loader.doList(Loader.java:2820)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2652)
at org.hibernate.loader.Loader.list(Loader.java:2647)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338)
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:2131)
at org.hibernate.internal.AbstractSharedSessionContract.list(AbstractSharedSessionContract.java:1163)
at org.hibernate.query.internal.NativeQueryImpl.doList(NativeQueryImpl.java:173)
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1530)
... 30 more
Caused by: java.sql.SQLException: Driver does not support the provided URL: jdbc:tracing:mysql://localhost/jg_services
at io.agroal.pool.ConnectionFactory.connectionSetup(ConnectionFactory.java:215)
at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
... 2 more

To Reproduce
Steps to reproduce the behavior:

  1. Start a Quarkus app that uses JPA with jdbc opentracing configuration url and driver:
    -Dquarkus.datasource.url=jdbc:tracing:mysql://localhost/xxx
    -Dquarkus.datasource.driver=io.opentracing.contrib.jdbc.TracingDriver

Configuration

# Add your application.properties here, if applicable.

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):
Quarkus 1.3.0.CR1

Additional context
Exact same app built with 1.3.0.Alpha1 works fine. Changing the version to CR1 causes the error

@bcluap bcluap added the kind/bug Something isn't working label Mar 9, 2020
@jaikiran
Copy link
Member

jaikiran commented Mar 9, 2020

Hello @bcluap,
Which Java version is this? Can you show us your application.properties? Or better still can you share a reproducer (preferably as a github repo) which reproduces this issue? We had fixed this in 1.3.0.Alpha2 #7089 but in your case it looks like it started failing in CR1, so we will need a few more details.

@geoand
Copy link
Contributor

geoand commented Mar 9, 2020

cc @gsmet (in case it could be config related) and @pavolloffay

@bcluap
Copy link
Author

bcluap commented Mar 9, 2020

git clone https://github.com/bcluap/quarkus.git
cd quarkus/getting-started/
mvn -DskipTests install

Then:
java -jar ./target/getting-started-1.0-SNAPSHOT-runner.jar
You will get "Communications link failure" which is fine as you won't have a DB running.

Then:
java -Dquarkus.datasource.driver=io.opentracing.contrib.jdbc.TracingDriver -Dquarkus.datasource.url=jdbc:tracing:mysql://127.0.0.1/xx -jar ./target/getting-started-1.0-SNAPSHOT-runner.jar
And you will get the error java.sql.SQLException: Driver does not support the provided URL: jdbc:tracing:mysql://127.0.0.1/xx

If you build with Alpha1 then the error goes away.

My environment:

paul@PCBLaptop:/Source/quarkus/getting-started$ java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04)
OpenJDK 64-Bit Server VM (build 11.0.5+10-post-Ubuntu-0ubuntu1.118.04, mixed mode, sharing)
paul@PCBLaptop:
/Source/quarkus/getting-started$ uname -a
Linux PCBLaptop 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@gsmet gsmet self-assigned this Mar 9, 2020
@gsmet
Copy link
Member

gsmet commented Mar 9, 2020

It's probably due to the new datasource config. I'll have a look tomorrow.

@gsmet
Copy link
Member

gsmet commented Mar 10, 2020

I just had a closer look at that one. The driver has always been a build time config: you cannot override it at runtime.

I don't know how it was working before, I find it surprising, but that's the expected behavior.

@gsmet
Copy link
Member

gsmet commented Mar 10, 2020

Just to be sure: does it work properly if you define the driver at build time?

@bcluap
Copy link
Author

bcluap commented Mar 10, 2020 via email

@loicmathieu
Copy link
Contributor

@bcluap can we close this issue ?

Is there a performance hit using the tracing driver if tracing is disabled?

There should be a small performance hit as spans will be created (but span creation should be cheap), with OpenTracing disabled the tracer implementation is a No-op tracer so there will be no network overhead.

@bcluap
Copy link
Author

bcluap commented Jun 25, 2021

Yes you can close this. Thanks

@geoand geoand closed this as completed Jun 25, 2021
@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

5 participants