Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1184

Infinite blocking during batch updates

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.4.0
    • N/A
    • batch
    • None
    • Aurora MySQL 5.7.12
      Spring Boot 3.3.0
      Spring Data JPA 3.3.0

    Description

      Hello,

      I am reporting a bug encountered during testing. When performing batch insert queries in Aurora MySQL 5.7.12 (for example, executing the `batchUpdate` method with Spring JDBC's `JdbcTemplate`), infinite blocking occurs. The thread dump in the situation where infinite blocking occurs is as follows:

      "http-nio-8080-exec-1" prio=0 tid=0x0 nid=0x0 runnable
           java.lang.Thread.State: RUNNABLE
       (in native)
      	at java.base@21.0.3/sun.nio.ch.Net.poll(Native Method)
      	at java.base@21.0.3/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:191)
      	at java.base@21.0.3/sun.nio.ch.NioSocketImpl.park(NioSocketImpl.java:201)
      	at java.base@21.0.3/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:309)
      	at java.base@21.0.3/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
      	at java.base@21.0.3/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
      	at java.base@21.0.3/java.net.Socket$SocketInputStream.read(Socket.java:1099)
      	at java.base@21.0.3/java.io.BufferedInputStream.fill(BufferedInputStream.java:291)
      	at java.base@21.0.3/java.io.BufferedInputStream.read1(BufferedInputStream.java:347)
      	at java.base@21.0.3/java.io.BufferedInputStream.implRead(BufferedInputStream.java:420)
      	at java.base@21.0.3/java.io.BufferedInputStream.read(BufferedInputStream.java:399)
      	at app//org.mariadb.jdbc.client.socket.impl.PacketReader.readReusablePacket(PacketReader.java:62)
      	at app//org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:164)
      	at app//org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:1234)
      	at app//org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:1173)
      	at app//org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:1092)
      	at app//org.mariadb.jdbc.client.impl.StandardClient.executePipeline(StandardClient.java:932)
      	at app//org.mariadb.jdbc.Statement.executeInternalBatchPipeline(Statement.java:1625)
      	at app//org.mariadb.jdbc.Statement.executeBatch(Statement.java:766)
      	at app//com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127)
      	at app//com.zaxxer.hikari.pool.HikariProxyStatement.executeBatch(HikariProxyStatement.java)
      	at app//org.springframework.jdbc.core.JdbcTemplate$1BatchUpdateStatementCallback.doInStatement(JdbcTemplate.java:592)
      	at app//org.springframework.jdbc.core.JdbcTemplate$1BatchUpdateStatementCallback.doInStatement(JdbcTemplate.java:578)
      	at app//org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
      	at app//org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:632)
      	at app//com.kurly.perfjdbcdriver.presentation.TestController.batch(TestController.java:40)
      	at java.base@21.0.3/java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)
      	at java.base@21.0.3/java.lang.invoke.LambdaForm$MH/0x00000008000c4800.invoke(LambdaForm$MH)
      	at java.base@21.0.3/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
      	at java.base@21.0.3/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:153)
      	at java.base@21.0.3/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.3/java.lang.reflect.Method.invoke(Method.java:580)
      	at app//org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)
      	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
      	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at app//org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
      	at app//org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
      	at app//org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:392)
      	at app//org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
      	at app//org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:768)
      	at app//org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
      	at app//com.kurly.perfjdbcdriver.presentation.TestController$$SpringCGLIB$$0.batch(<generated>)
      	at java.base@21.0.3/java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)
      	at java.base@21.0.3/java.lang.invoke.LambdaForm$MH/0x00000008000c4800.invoke(LambdaForm$MH)
      	at java.base@21.0.3/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
      	at java.base@21.0.3/jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(DirectMethodHandleAccessor.java:153)
      	at java.base@21.0.3/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      	at java.base@21.0.3/java.lang.reflect.Method.invoke(Method.java:580)
      	at app//org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)
      	at app//org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)
      	at app//org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
      	at app//org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926)
      	at app//org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831)
      	at app//org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
      	at app//org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
      	at app//org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
      	at app//org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
      	at app//org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
      	at app//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
      	at app//org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
      	at app//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
      	at app//org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
      	at app//org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
      	at app//org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
      	at app//org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
      	at app//org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
      	at app//org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
      	at app//org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
      	at app//org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
      	at app//org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
      	at app//org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
      	at app//org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
      	at app//org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
      	at app//org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
      	at app//org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
      	at app//org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
      	at app//org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
      	at app//org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
      	at app//org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
      	at app//org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
      	at app//org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
      	at app//org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
      	at app//org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
      	at app//org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      	at app//org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
      	at app//org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
      	at app//org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
      	at app//org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
      	at app//org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
      	at app//org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
      	at app//org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
      	at app//org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
      	at app//org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
      	at java.base@21.0.3/java.lang.Thread.runWith(Thread.java:1596)
      	at java.base@21.0.3/java.lang.Thread.run(Thread.java:1583)
      

      This issue did not occur when the `useServerPrepStmts=true` option was added to the JDBC URL. When tested on Aurora MySQL 8.0.32, it worked correctly even without adding this option.

      Considering this situation, it appears that infinite blocking occurs due to compatibility issues between the server and client when using Aurora MySQL 5.7.12 with MariaDB Connector/J 3.4.0 and client-side prepared statements. I would appreciate it if you could look into this issue.

      Thank you.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            Jang Junyeong Junyeong Jang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.