quarkiverse / quarkus-jberet

Quarkus Extension for Batch Applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transaction timeout not working

Emiliopg91 opened this issue · comments

Hi

Using last version of quarkus-jberet and quarkus 3.0.0.RC2 I'm having troubles with transaction timeout

I specify a timeout of 300 seconds using the step property "jakarta.transaction.global.timeout" (also tried with "javax.transaction.global.timeout") but when I have a big chunk, when commit, it fails after 60 seconds:

Hi

Using last version of quarkus-jberet and quarkus 3.0.0.RC2 I'm having troubles with transaction timeout

I specify a timeout of 300 seconds using the step property "jakarta.transaction.global.timeout" (also tried with "javax.transaction.global.timeout") but when I have a big chunk, when commit, it fails after 60 seconds:

JBERET000007: Failed to run job job, updateValues, org.jberet.job.model.Chunk@27a222f3: jakarta.transaction.RollbackException: ARJUNA016102: The transaction is not active! Uid is 0:ffffc0a82f3c:cbca:644a2fa7:18
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1285)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:128)
at io.quarkus.narayana.jta.runtime.NotifyingTransactionManager.commit(NotifyingTransactionManager.java:70)
at org.jberet.runtime.runner.ChunkRunner.doCheckpoint(ChunkRunner.java:596)
at org.jberet.runtime.runner.ChunkRunner.readProcessWriteItems(ChunkRunner.java:358)
at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:206)
at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:223)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:142)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:170)
at org.jberet.runtime.runner.CompositeExecutionRunner.runJobElement(CompositeExecutionRunner.java:134)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:200)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:170)
at org.jberet.runtime.runner.CompositeExecutionRunner.runJobElement(CompositeExecutionRunner.java:134)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:200)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:170)
at org.jberet.runtime.runner.CompositeExecutionRunner.runJobElement(CompositeExecutionRunner.java:134)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:200)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:170)
at org.jberet.runtime.runner.CompositeExecutionRunner.runJobElement(CompositeExecutionRunner.java:134)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:200)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:170)
at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:94)
at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:58)
at org.jberet.spi.JobExecutor$1.run(JobExecutor.java:100)
at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)

It's well known that timeout for Quarkus managed transactions is 60 seconds.

Is there any trouble with transaction timeout handling/overriding?

Thank you!

Hum, the timeout is set directly in the transaction by JBeret. Are you able to provide me with a reproducer so I can have a look?

I'll provide you an example ASAP

However, if you use a DataBase writer and force a delay of... 70 seconds for example before writeItems method ends, you will see that exception

I think that the trouble is Quarkus integration with Arjuna and Narajana transactions because the only way to change the transaction timeout is setting "quarkus.transaction-manager.default-transaction-timeout"

Launching the application with -Dquarkus.transaction-manager.default-transaction-timeout=180S is the only way I found to have a real 180 seconds timeout

Hum... maybe Quarkus is overriding the transaction timeout somehow. I'll have to check.

I usually ask for a reproducer to make sure I run with the same configuration and dependencies, which sometimes make a difference.

I did try to reproduce with no luck. Closing the issue, please reopen if you are to provide me with a reproducer. Thank you!