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

Timer task doesn't stop after finishing query

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 2.4.0
    • N/A
    • Other
    • None

    Description

      Create MariaDbStatement with queryTimeout and exequte a query.
      In this moment will be created new thread with name"MariaDB-timeout-1".
      But after finishing the query this thread is still alive.
      As result, if we have web application on Tomcat and interrupt it, we get warning:

      13-Feb-2019 17:42:10.645 WARNING [Thread-5] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [...] appears to have started a thread named [MariaDb-timeout-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
       sun.misc.Unsafe.park(Native Method)
       java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
       java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
       java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
       java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
       java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
       java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
       java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       java.lang.Thread.run(Thread.java:748)
      
      

      This case is reproduced on Tomcat 8.5.37 with mariadb-java-client 2.4.0

      Attachments

        Issue Links

          Activity

            diego dupin Diego Dupin added a comment -

            Can you confirm server version is < 10.1.2 ?

            diego dupin Diego Dupin added a comment - Can you confirm server version is < 10.1.2 ?
            pavzay Pavel Zaichyk added a comment - - edited

            I catched this problem on mariadb version 10.0.38
            But problem doesn't reproduce on 10.4.2

            pavzay Pavel Zaichyk added a comment - - edited I catched this problem on mariadb version 10.0.38 But problem doesn't reproduce on 10.4.2
            diego dupin Diego Dupin added a comment -

            closing since duplicate CONJ-563

            diego dupin Diego Dupin added a comment - closing since duplicate CONJ-563

            People

              diego dupin Diego Dupin
              pavzay Pavel Zaichyk
              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.