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

transaction timeout on Reactive flavor + Narayana #30754

Open
pjgg opened this issue Jan 31, 2023 · 3 comments
Open

transaction timeout on Reactive flavor + Narayana #30754

pjgg opened this issue Jan 31, 2023 · 3 comments

Comments

@pjgg
Copy link
Contributor

pjgg commented Jan 31, 2023

Describe the bug

After making several transactions with Narayana + reactive flavor API the DB connection is blocked and throw the following exception:

ERROR [org.hib.rea.errors] (vert.x-eventloop-thread-1) HR000057: Failed to execute statement [select accountent0_.id as id1_0_, accountent0_.accountNumber as accountn2_0_, accountent0_.amount as amount3_0_, accountent0_.createdAt as createda4_0_, accountent0_.lastName as lastname5_0_, accountent0_.name as name6_0_, accountent0_.updatedAt as updateda7_0_ from account accountent0_ where accountent0_.accountNumber=$1]: could not execute query: java.util.concurrent.CompletionException: io.vertx.core.impl.NoStackTraceThrowable: Timeout
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:636)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
	at io.vertx.core.Future.lambda$toCompletionStage$3(Future.java:386)
	at io.vertx.core.impl.future.FutureImpl$3.onFailure(FutureImpl.java:153)
	at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
	at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
	at io.vertx.core.impl.future.Mapping.onFailure(Mapping.java:45)
	at io.vertx.core.impl.future.FutureImpl$ListenerArray.onFailure(FutureImpl.java:268)
	at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:75)
	at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:230)
	at io.vertx.core.impl.future.PromiseImpl.tryFail(PromiseImpl.java:23)
	at io.vertx.core.impl.future.PromiseImpl.onFailure(PromiseImpl.java:54)
	at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:43)
	at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:23)
	at io.vertx.sqlclient.impl.pool.SqlConnectionPool$1PoolRequest.lambda$null$1(SqlConnectionPool.java:218)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool$Cancel.run(SimpleConnectionPool.java:676)
	at io.vertx.core.net.impl.pool.CombinerExecutor.submit(CombinerExecutor.java:50)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool.execute(SimpleConnectionPool.java:245)
	at io.vertx.core.net.impl.pool.SimpleConnectionPool.cancel(SimpleConnectionPool.java:638)
	at io.vertx.sqlclient.impl.pool.SqlConnectionPool$1PoolRequest.lambda$onEnqueue$2(SqlConnectionPool.java:215)
	at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:932)
	at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:903)
	at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:55)
	at io.vertx.core.impl.DuplicatedContext.emit(DuplicatedContext.java:158)
	at io.vertx.core.impl.ContextInternal.emit(ContextInternal.java:194)
	at io.vertx.core.impl.VertxImpl$InternalTimerHandler.run(VertxImpl.java:921)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.vertx.core.impl.NoStackTraceThrowable: Timeout

If I remove the annotation @transaction then is working as expected

these are the extensions that I am using:

quarkus-reactive-pg-client
quarkus-resteasy-reactive-jackson
quarkus-hibernate-reactive-panache
quarkus-narayana-jta

Based on the official documentation seems that the only thing that I should do is to add the annotation @transaction. Do you know if there is something else that needs to be configured?.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

git clone --branch QUARKUS-2492-reactive_02 git@github.com:pjgg/quarkus-test-suite.git
cd quarkus-test-suite/sql-db/reactive-narayana-transactions
mvn quarkus:dev

And then make the following query....around 5 times until block the thread

curl -X POST -H "Content-type:application/json" -d '{"accountTo": "SK0389852379529966291984", "accountFrom": "FR9317569000409377431694J37", "amount": "10"}' http://localhost:8080/transfer/transaction
@pjgg pjgg added the kind/bug Something isn't working label Jan 31, 2023
@yuhaibohotmail
Copy link

As far as I am concerned, reactive-pg-client don't support jta.

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 1, 2023

/cc @tsegismont (reactive-sql-clients), @vietj (reactive-sql-clients)

@geoand
Copy link
Contributor

geoand commented Feb 1, 2023

cc @Sanne @DavideD

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

3 participants