From: Dan Nelson Date: July 28 2006 5:00pm Subject: Re: Threads of terminated clientapplications List-Archive: http://lists.mysql.com/mysql/200399 Message-Id: <20060728170026.GB15827@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In the last episode (Jul 28), AndrĂ© Ress said: > We have a problem with abortet clients and long time querys. > > If our application performs a long time select statement on the mySql > database and the application is abortet, the query still runs! We > tried several time-out variables like wait_timeout, > interactive_timeout or connection_timeout but without success. What > we need is, that the connection thread gets terminated after the > client application was abnormaly terminated. We currently use a > mySQL V5.0.20 server and have the problem under windows and linux os. > > Terminating the thread with KILL is not possible option, it has to be > terminated automatically. You might want to file an enhancement bugreport on this. It would probably require a watchdog mysqld thread that does a select() or poll() on all active client connections periodically (every 60 seconds or so?) to see whether they have been closed at the remote end, and if they have, it sends a kill to the thread currently running a query. Note that if your application is a web-based one, you will also have to do this check yourself (i.e. poll the browser socket so you know when they have hit the Stop button, and if they have, then close your connection to the database). -- Dan Nelson dnelson@stripped