There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-5beee25e-05a6-443a-9895-009cd20d30fa XWIKI-17610 Open

Notification mails should be paginated

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-184a1f52-a964-48cd-85da-8d8e43bb3b5c Simon Urli on 15/Oct/26 16:55
 

Note that the memory problem is not only in the produced mail: the events are also all loaded at once before rendering. DefaultPeriodicMimeMessageIterator sets expectedCount = Integer.MAX_VALUE / 4, which DefaultParametrizedNotificationManager#getRawEvents turns into a single search of ~1 billion rows (the MAX_BATCH_SIZE of 1280 is never reached since the batch size already starts above it). So all the events a user listens to since the last trigger end up in memory at the same time, e.g. when a user watching a space receives daily mails and hundreds of thousands of pages are created in that space during the day (see XWIKI-10594). Paginating the mails should also paginate the retrieval of the events.