[CONJ-683] Timer task doesn't stop after finishing query Created: 2019-02-13  Updated: 2019-09-13  Resolved: 2019-09-13

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.4.0
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Pavel Zaichyk Assignee: Diego Dupin
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates CONJ-563 Thread leak reported by Tomcat when u... Closed

 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



 Comments   
Comment by Diego Dupin [ 2019-02-14 ]

Can you confirm server version is < 10.1.2 ?

Comment by Pavel Zaichyk [ 2019-02-15 ]

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

Comment by Diego Dupin [ 2019-09-13 ]

closing since duplicate CONJ-563

Generated at Thu Feb 08 03:17:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.