Bug #65998 Event runs again as per the schedule even if an instance of it is still running
Submitted: 24 Jul 2012 14:51 Modified: 24 Jul 2012 15:50
Reporter: Venkat Ram Santosh Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.5.21 OS:Linux
Assigned to: CPU Architecture:Any

[24 Jul 2012 14:51] Venkat Ram Santosh
Description:
I have been trying to work with event scheduler and it seemed all good, I had an event running every 1 minutes doing some processing I needed. Suddenly I saw multiple instances of it running when the first instance of the event was already running. I was an Oracle developer before and this isn't how the job scheduler in Oracle works. If the job if already running then we couldn't run the same job again, nor the DB would try to run the job again. I think this is a bug in MySQL. If the event scheduler in MySQL was designed like this for any reason. Plz let me know.

How to repeat:
Can create any event that takes a while to process and finish and have an event every 1 minute should repeat this problem.
[24 Jul 2012 15:15] Valeriy Kravchuk
Sorry, but MySQL events are different from Oracle jobs in this case. Please, read the manual http://dev.mysql.com/doc/refman/5.5/en/events-overview.htm:

"If a repeating event does not terminate within its scheduling interval, the result may be multiple instances of the event executing simultaneously. If this is undesirable, you should institute a mechanism to prevent simultaneous instances. For example, you could use the GET_LOCK() function, or row or table locking."

So, it's by design, not a bug. If you do not like this design we can try to make a feature request out of this report, but then note that even if feature request is accepted it may take years until you see it implemented in GA release. Immediate fix is to make sure your event code prevents multiple executions.
[24 Jul 2012 15:31] Venkat Ram Santosh
OK. Can we make a feature request out of this please. I hope to see a day when MySQL has most of the features of Oracle!
[24 Jul 2012 15:50] Valeriy Kravchuk
OK, so this is the feature request: prevent starting of the second copy of a repeating event until current copy finished execution.
[20 Feb 2015 7:44] MySQL Verification Team
duplicate of http://bugs.mysql.com/bug.php?id=34389