Re: MySQLQueryInterruptedException while no one killed the query
Posted by: Todd Farmer
Date: October 07, 2014 04:34PM

Hi Nikolay,

Yes, setQueryTimeout() could kill a query in 2ms. The most likely scenario is a race condition, where the previous query had setQueryTimeout(1) set, and the thread executing the KILL command was triggered, but not received/processed by the server until after the intended target query completed. This sets the server-side kill flag on the connection handler, causing the following new query to be immediately aborted. That's the subject of Bug#70618 (which is a duplicate of an earlier reported bug, and fixed in MySQL Server 5.7.1).

It's also conceivably possible to use setQueryTimeout(0), which could result in similar behavior. If your timeout threshold is set dynamically, you might check for that.

I can't speak for the behavior you observe in JRE 1.7 with JBoss, sorry - sounds like something to chase up on the JBoss side.

Turning on the MySQL Server general query log will tell you exactly who and when the KILL operations are coming from, and remove a lot of the speculation we're engaging in here.

Hope that helps!

Todd Farmer
MySQL @ Oracle

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.