When Mysql chose to kill a Process(automatically) I faced some real issues regarding the execution of some stored procedures using Mysql server. Sometimes, one of my procedures is not executed (or maybe stopped) during an external call (from app) so I'm wondering :


Is it possible that Mysql could stop automatically the and kill the
process?
if is it true, what are the indicators and factors that make Mysql
chose its victim?
Is there an alternative to set up a list of priority of running
queries?


Thanks.
MySQL can kill a connection if it exceeds wait_timeout.  (Caution, there are various wait timeout settings.)
InnoDB can kill a transaction in the case of a &quot;deadlock&quot;.  One of the competing transactions is killed, the other(s) are allowed to continue.
InnoDB can kill a query if it is waiting too long for a lock.  See innodb_lock_wait_timeout, which defaults to 50 seconds.
A user can &quot;kill&quot; a mysql process via the commandline tool 'mysql' and it's kill command.
I don't think there is anything special about Stored Procedures, Functions, Events, Triggers -- they are essentially collections of queries that are, in turn, subject to the comments above.
UDFs contain code written by users and specially installed.  These can do anything nasty that you like.
There are essentially no &quot;priorities&quot; that you can control.  It is better to let MySQL decide what to do when.
Do you mean something else by &quot;process&quot;?