Summary | Allowed memory size exhausted |
Queue | Kronolith |
Queue Version | 4.2.17 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | mrubinsk (at) horde (dot) org |
Requester | lukas.weiss (at) raiffeisen (dot) it |
Created | 08/24/2016 (3244 days ago) |
Due | |
Updated | 10/19/2020 (1727 days ago) |
Assigned | 08/25/2016 (3243 days ago) |
Resolved | 08/27/2016 (3241 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
commit 4c18212c3b61d81486f2a9243f649eababa347ed
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat, 27 Aug 2016 11:09:54 -0400
Take 2 on fix for
Bug #14453M lib/Kronolith.php
https://github.com/horde/kronolith/commit/4c18212c3b61d81486f2a9243f649eababa347ed
commit 9cc4afae289ef81e3d075eb9510d4d909e91cbf9
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat, 27 Aug 2016 11:08:35 -0400
Revert "Revert "
Bug: 14453Limit addCoverDates to the $endDate.""This reverts commit 31e24657b1a79406be6ed7f4c60bb1a595cda0a5.
M lib/Kronolith.php
https://github.com/horde/kronolith/commit/9cc4afae289ef81e3d075eb9510d4d909e91cbf9
commit 8ab1e13477340cb5d28eeda0f2d4aabee3b47744
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri, 26 Aug 2016 12:50:20 -0400
Revert "
Bug: 14453Limit addCoverDates to the $endDate."This reverts commit 81d537938065067860038a8f2186e0207c134235.
M lib/Kronolith.php
https://github.com/horde/kronolith/commit/8ab1e13477340cb5d28eeda0f2d4aabee3b47744
commit f3688a15361ed1a1dc3b039b485a9532f0fbcfc7
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed, 24 Aug 2016 22:38:42 -0400
Bug: 14453Limit addCoverDates to the $endDate.Prevents memory issues, or looping unnecessarily for extremely
long events.
M lib/Kronolith.php
https://github.com/horde/kronolith/commit/f3688a15361ed1a1dc3b039b485a9532f0fbcfc7
State ⇒ Resolved
commit d39dd96177af4438529f9fe6b3df0a27ce6c5c74
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat Aug 27 11:09:54 2016 -0400
Take 2 on fix for
Bug #14453kronolith/lib/Kronolith.php | 10 ++++++++++
1 file changed, 10 insertions(+)
http://github.com/horde/horde/commit/d39dd96177af4438529f9fe6b3df0a27ce6c5c74
commit 3caff29bf91b5a72e0a7e753ed3198c03648a692
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat Aug 27 11:08:35 2016 -0400
Revert "Revert "
Bug: 14453Limit addCoverDates to the $endDate.""This reverts commit 31e24657b1a79406be6ed7f4c60bb1a595cda0a5.
kronolith/lib/Kronolith.php | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
http://github.com/horde/horde/commit/3caff29bf91b5a72e0a7e753ed3198c03648a692
commit 89d229a30bcda9f01250ae7cbac0f5f57ef9fdfc
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat Aug 27 11:04:14 2016 -0400
Take 2 on fix for
Bug: 14453.kronolith/lib/Kronolith.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
http://github.com/horde/horde/commit/89d229a30bcda9f01250ae7cbac0f5f57ef9fdfc
commit 0f9a27ac7bcdc6de7780dabd25dbcf0b229d386d
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Sat Aug 27 10:47:51 2016 -0400
Revert "Revert "
Bug: 14453Limit addCoverDates to the $endDate.""This reverts commit 4bd7428e438a50537882c70e1a71f90a963ff856.
kronolith/lib/Kronolith.php | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
http://github.com/horde/horde/commit/0f9a27ac7bcdc6de7780dabd25dbcf0b229d386d
commit 31e24657b1a79406be6ed7f4c60bb1a595cda0a5
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri Aug 26 12:50:20 2016 -0400
Revert "
Bug: 14453Limit addCoverDates to the $endDate."This reverts commit 81d537938065067860038a8f2186e0207c134235.
kronolith/lib/Kronolith.php | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
http://github.com/horde/horde/commit/31e24657b1a79406be6ed7f4c60bb1a595cda0a5
commit 4bd7428e438a50537882c70e1a71f90a963ff856
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri Aug 26 12:44:23 2016 -0400
Revert "
Bug: 14453Limit addCoverDates to the $endDate."This reverts commit 7695fc444ff10bd9950f0332c27c5c5874397d0a.
This isn't correct. Setting $endDate to $event->end defeats the purpsose
of this change when polling for alarms but removing that line
will no longer return multi-day events that start before $startDate
when no $endDate is provided.
Not sure what the solution is here since when polling alarms we
don't want an end date - no way of knowing the longest alarm interval
that we have.
Perhaps always limiting to some unrealistic time frame like 10 years
would be sufficient for protecting against memory limits while still
allowing reasonable alarm intervals to be supported?
kronolith/lib/Kronolith.php | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
http://github.com/horde/horde/commit/4bd7428e438a50537882c70e1a71f90a963ff856
coverEvents in certain cases (like when a multiday event starts before
$startDate) so in certain cases alarms would be missed.
In the Kronolith_Driver_Sql::listAlarms, listEvents is called
without an endDate parameter... Then in
Kronolith_Driver_Sql::_listEvents, addEvents is called without this
parameter too. So the loop doesn't stop before the original event's
end date...
addEvents, then the check $loopDate->compareDateTime($endDate) returns
false, thus breaking the loop.
I still can't get the stable code (FRAMEWORK_5_2) to break with this
patch. However, I AM having problems with the git master code at the
moment.
it immediately shows me the reminder popup and if I switch to trean
(without dismissing the alarm), everything is working...
but then, if I don't dismiss the popup, logout and relogin i get the
same error as described before. maybe you can try this too?
in the first place. I'll look later tonight or tomorrow regarding that
code path.
screenshot is from). Unless you are running a git checkout, that is.
There were too many changes to that code to cherry-pick from master
to FW_52.
So, it is still failing for you with the FW_52 patches?
I tried to create a new event from 1900 to 2800 with an alarm set...
it immediately shows me the reminder popup and if I switch to trean
(without dismissing the alarm), everything is working...
but then, if I don't dismiss the popup, logout and relogin i get the
same error as described before. maybe you can try this too?
i will have a look tomorrow again... thanks for your help.
screenshot is from). Unless you are running a git checkout, that is.
There were too many changes to that code to cherry-pick from master to
FW_52.
So, it is still failing for you with the FW_52 patches?
State ⇒ Assigned
New Attachment: image.jpeg
start/end you provided. It works with this patch, does not work
without it. Screenshot attached. I will look further into the code
path you are talking about, but your original issue seems to be
resolved locally.
In the Kronolith_Driver_Sql::listAlarms, listEvents is called without
an endDate parameter... Then in Kronolith_Driver_Sql::_listEvents,
addEvents is called without this parameter too. So the loop doesn't
stop before the original event's end date...
Here's the stack trace (e.g. calling trean at the beginning):
#0 Kronolith::addEvents() called at
[/usr/share/nginx/www/kronolith/lib/Driver/Sql.php:312]
#1Kronolith_Driver_Sql->_listEvents() called at[/usr/share/nginx/www/kronolith/lib/Driver.php:310]
#2Kronolith_Driver->listEvents() called at[/usr/share/nginx/www/kronolith/lib/Driver/Sql.php:82]
#3Kronolith_Driver_Sql->listAlarms() called at[/usr/share/nginx/www/kronolith/lib/Kronolith.php:120]
#4Kronolith::listAlarms() called at[/usr/share/nginx/www/kronolith/lib/Application.php:492]
#5Kronolith_Application->listAlarms()#6call_user_func_array() called at [/usr/share/php/Horde/Registry.php:1196]#7Horde_Registry->callAppMethod() called at[/usr/share/php/Horde/Core/Factory/Alarm.php:170]
#8Horde_Core_Factory_Alarm->load()#9call_user_func() called at [/usr/share/php/Horde/Alarm.php:113]#10Horde_Alarm->listAlarms() called at [/usr/share/php/Horde/Alarm.php:431]#11Horde_Alarm->notify() called at[/usr/share/php/Horde/Notification/Handler/Decorator/Alarm.php:63]
#12Horde_Notification_Handler_Decorator_Alarm->notify() called at[/usr/share/php/Horde/Notification/Handler.php:323]
#13 Horde_Notification_Handler->notify() called at
[/usr/share/php/Horde/Core/Notification/Handler.php:49]
#14Horde_Core_Notification_Handler->notify() called at[/usr/share/nginx/www/trean/add.php:81]
#15require(/usr/share/nginx/www/trean/add.php) called at[/usr/share/nginx/www/trean/browse.php:19]
#16require(/usr/share/nginx/www/trean/browse.php) called at[/usr/share/nginx/www/trean/index.php:11]
Assigned to Michael Rubinsky
commit 7695fc444ff10bd9950f0332c27c5c5874397d0a
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Aug 24 22:44:16 2016 -0400
Bug: 14453Limit addCoverDates to the $endDate.kronolith/lib/Kronolith.php | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
http://github.com/horde/horde/commit/7695fc444ff10bd9950f0332c27c5c5874397d0a
commit 81d537938065067860038a8f2186e0207c134235
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Aug 24 22:38:42 2016 -0400
Bug: 14453Limit addCoverDates to the $endDate.Prevents memory issues, or looping unnecessarily for extremely
long events.
kronolith/lib/Kronolith.php | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
http://github.com/horde/horde/commit/81d537938065067860038a8f2186e0207c134235
I logged $eventStart and $eventEnd before the loop, which was from
2016 to 2800.
Kronolith::addEvents function ($loopDate), which iterates through
every day of the event causing the memory failure.
be the end of the time period we need to load (I.e., one month for the
month view etc...). Perhaps this isn't working correctly. I"ll take a
look when I'm back in my office.
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Allowed memory size exhausted
Type ⇒ Bug
Queue ⇒ Kronolith
I got an error saying the allowed memory size of 512 mb was exhausted.
after some debugging I found a user which somehow created an event
from 0900-02-03 12:00:00 to 2800-02-04 13:00:00 with an alarm.
this prevented horde from being loaded, no matter if Kronolith or
Trean was opened, because the alarms are loaded every time.
I found the problem is the while-loop at the end of the
Kronolith::addEvents function ($loopDate), which iterates through
every day of the event causing the memory failure.
Is it possible to stop the loop at some point to prevent this error?
Thanks