This issue has been created
There are 3 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0a88f191-1280-416b-a2ff-270e10e2f589 XWIKI-25412 Open

The notifications loop forever when the requested count is 0 or not a number

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-64f2e64c-0b77-47bf-994d-74dc257ff65f Charpentier Lucas created this issue on 19/Oct/26 16:45
 
Summary: The notifications loop forever when the requested count is 0 or not a number
Issue Type: cid:jira-generated-image-avatar-0a88f191-1280-416b-a2ff-270e10e2f589 Bug
Affects Versions: 10.11.4, 18.8.0
Assignee: Unassigned
Components: Notifications
Created: 19/Oct/26 16:45
Priority: cid:jira-generated-image-static-major-0f82cf4a-2756-40c0-82d1-0790281393eb Major
Reporter: Charpentier Lucas
Description:

Steps to reproduce

Edit a page, insert the Notifications macro with a count of 0, then save and view the page.

{{notifications count="0"/}}

The same happens with a count that is not a number, like count="abc" or count="1.5".

Expected result

The macro shows no event, or an error message saying that the count must be a positive number.

Actual result

The macro stays on its loading placeholder forever, and the server keeps one CPU busy for each such page view. The asynchronous rendering job never ends: in DefaultParametrizedNotificationManager#getRawEvents, the batch size is expectedCount * 2, so 0. Each search returns an empty batch, batch.size() < batchSize is false since 0 < 0, and batchSize <<= 1 keeps it at 0, so the loop never stops, running a Solr query on every pass.

Two such stuck jobs fill the notifications job group: every Notifications macro of the wiki then stays on its placeholder until the instance is restarted, and a normal shutdown no longer completes.

Any user who can edit a page can trigger it. The REST resource /rest/notifications takes a count parameter too, and may reach the same code, which was not tried.

The loop was introduced by XWIKI-15927. Found while auditing the macro for the WYSIWYG usability of XWiki macros, on XWiki 18.8.0: https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/notifications/

 
 

3 updates

 
cid:jira-generated-image-avatar-64f2e64c-0b77-47bf-994d-74dc257ff65f Changes by Charpentier Lucas on 19/Oct/26 16:45
 
Fix Version: 18.9.0
Assignee: Charpentier Lucas
Priority: Major Critical