Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

After upgrading to spring batch 5 from spring batch 4, service is failing on load #4789

Unanswered
ankur-jain1-hp asked this question in Q&A
Discussion options

Bug description
After the upgrade, during a load test, the service threads are getting blocked due to the below error and the service is returning 504 timeout but this behavior is not with spring batch 4. Please help
stackTrace:

java.lang.Thread.State: BLOCKED (on object monitor)
at org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer.getNextKey(MySQLMaxValueIncrementer.java:118)
- waiting to lock <0x00000000c322ddf0> (a org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer)
at org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer.nextLongValue(AbstractDataFieldMaxValueIncrementer.java:128)
at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:150)
at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:169)
at java.lang.invoke.LambdaForm$DMH/0x0000004001e90000.invokeInterface(java.base@21.0.5/LambdaForm$DMH)
at java.lang.invoke.LambdaForm$MH/0x0000004002038800.invoke(java.base@21.0.5/LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/0x0000004001002800.invokeExact_MT(java.base@21.0.5/LambdaForm$MH)
at jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.base@21.0.5/DirectMethodHandleAccessor.java:155)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.base@21.0.5/DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke(java.base@21.0.5/Method.java:580)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.transaction.interceptor.TransactionInterceptor1ドル.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:391)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean.lambda$getObject0ドル(AbstractJobRepositoryFactoryBean.java:204)
at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$$Lambda/0x0000004001f122e0.invoke(Unknown Source)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)
at jdk.proxy3.$Proxy118.createJobExecution(jdk.proxy3/Unknown Source)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:145)
at org.springframework.batch.core.launch.support.TaskExecutorJobLauncher.run(TaskExecutorJobLauncher.java:59)

Environment
Spring Batch version - 5
Java version - 21
database - MySQL

Expected behavior
there should not be any 504 and service should keep on receiving requests

You must be logged in to vote

Replies: 3 comments

Comment options

I think you will encounter same issue with Spring Batch 4 if the load is heavy enough.

You must be logged in to vote
0 replies
Comment options

load is much less( just 5 RPS of a batch of 25). The spring batch 4 was easily able to handle this

You must be logged in to vote
0 replies
Comment options

I see nothing in v5 that changed with regard to the job launcher in Spring Batch. So this issue might happen with v4 as well. But since it seems to happen at the incrementer level (MySQLMaxValueIncrementer), I guess it might not be related to Spring Batch. Can you please provide a minimal example that reproduces the issue? A GitHub repo or a Docker-based integration test would be great (we have an example here).

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter type: bug
Converted from issue

This discussion was converted from issue #4788 on March 21, 2025 10:21.

AltStyle によって変換されたページ (->オリジナル) /