[OPENAM-6748] Improve mechanics of the notification cache Created: 02/Sep/15 Updated: 19/Jul/19 Resolved: 31/Jan/18
|Fix Version/s:||13.5.3, 6.0.0, 14.1.2, 5.5.2|
|Reporter:||Ian Packer [X] (Inactive)||Assignee:||Adam Heath|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Sprint:||AM Sustaining Sprint 44, AM Sustaining Sprint 45, AM Sustaining Sprint 46, AM Sustaining Sprint 47|
|Support Ticket IDs:|
Currently the notification cache is designed to hold com.sun.am.event.notification.expire.time minutes worth of notification objects. The default and minimum value for this is 30 minutes.
Since the source of new notifications can be a completely external source (i.e persistent search results from a remote datastore) it might be useful to have further controls/measures on this cache to prevent OpenAM becoming overwhelmed with notification data in the event of an unusual external event.
Currently, if a very large set of changes gets pushed through the persistent search mechanism (could be a large data migration/import or a misbehaving remote system) OpenAM will keep storing notifications with no upper limit on total memory used for this cache. As long as network/CPU performance is high enough OpenAM can easily receive too many notifications to store in memory over a 30 minute period.
An additional mechanism to prevent the server running itself out of memory would be a useful addition for robustness purposes. Additionally, 30 minutes seems like quite a long minimum value for this cache - are there any reasons it couldn't be decreased to 10 or 15 minutes?
|Comment by Peter Major [X] (Inactive) [ 09/Jan/17 ]|
Phill Cunnington is 14 still susceptible for these kind of issues with the new notification system?
|Comment by Adam Heath [ 30/Jan/18 ]|
Made some changes here to improve the caching logic slightly so that if the cache size is 0 OR no notification URLs are registered then no cache will be populated. Previously the logic here required the cache size to be 0 AND no URLs registered before the cache was ignored.
0 is the minimum value which can be provided for this setting - which will result in this cache not being used at all. Default value for this setting has also now been modified to be 5 minutes using the serverDefaults.properties file, as this was determined to be a more reasonable value to use - this also matches the value being used in the functional tests.
Setting this value via the serverdefaults.properties file means that this value will be updated when going through the upgrade process (if the value has not previously been set).
Hopefully these changes should improve things here for customers by reducing this cache from being populated unnecessarily.
Jonathan Thomas - unsure what we want to do with this JIRA going forward. Taking into consideration it's age and the changes made above - perhaps these changes are significant enough to mark the bug as resolved, or do you feel any further work is required here?
|Comment by Jonathan Thomas [ 31/Jan/18 ]|
I think it is good to be resolved as this cache being unnecessarily used and overwhelmed with notification data in the event of an unusual external event (time limit is less) should be fixed.
|Comment by Adam Heath [ 31/Jan/18 ]|
Marking as 'Fixed' based on the improvements and comments made above.