Commit 39c60116 authored by Sivert Sorumgard's avatar Sivert Sorumgard Committed by Sergei Golubchik

Bug#30628268: OUT OF MEMORY CRASH

The event scheduler has a THD which is used for e.g. keeping track
of the timing of the events. Thus, each scheduling of an event will
make use of this THD, which in turn allocates memory in the THD's
mem root. However, the mem root was never cleared, and hence, the
memory occupied would monotonically increase throughout the life
time of the server.

The root cause was found by Jon Olav Hauglid, and this fix clears the
THD's mem root for each event being scheduled.

Change-Id: I462d2b9fd9658c9f33ab5080f7cd0e0ea28382df
parent 6bb28e0b
/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2006, 2019, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -490,6 +491,7 @@ Event_scheduler::run(THD *thd)
DBUG_PRINT("info", ("job_data is NULL, the thread was killed"));
}
DBUG_PRINT("info", ("state=%s", scheduler_states_names[state].str));
free_root(thd->mem_root, MYF(0));
}
LOCK_DATA();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment