[CONJ-530] Permit Connection.abort() forcing killing the connection, even if connection is stuck in another thread Created: 2017-09-25  Updated: 2017-10-04  Resolved: 2017-10-04

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.1.1
Fix Version/s: 2.2.0, 1.7.0

Type: Bug Priority: Major
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

Abort() goal is to close the connection whatever the current state is. Current implementation doesn't fullfill this requirement :

Actually, if a connection is used by a thread, stuck executing a query,
another thread calling Connection.abort() will fail to close the connection, waiting for the query to finish.

ReentrantLock use for multithreading is an atomic counter, permitting to know if there is really a running query.
Idle connection must be closed like a normal close() do (COM_QUIT), buzy connection must use create another connection, emit a KILL command, and send an RST packet (server will then have a normal error log entry)



 Comments   
Comment by Diego Dupin [ 2017-10-04 ]

correction done in 2.2.0-SNAPSHOT and 1.6.6-SNAPSHOT :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>2.2.0-SNAPSHOT</version>
    </dependency>
</dependencies>

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