This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-07b730cc-d086-4726-8298-848a2de50e64 XWIKI-25296 Open

The begin and end events of a remote refactoring job are handled on different threads, which breaks the observation context

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-69376888-3fa8-4703-bf6f-5ff23eb72924 Claude created this issue on 14/Oct/26 18:39
 
Summary: The begin and end events of a remote refactoring job are handled on different threads, which breaks the observation context
Issue Type: cid:jira-generated-image-avatar-07b730cc-d086-4726-8298-848a2de50e64 Bug
Affects Versions: 18.8.0
Assignee: Unassigned
Components: Old Core
Created: 14/Oct/26 18:39
Priority: cid:jira-generated-image-static-major-c934edeb-21a8-4055-b474-2afdeaada6d9 Major
Reporter: Claude
Description:

Finding from a two-member compose cluster (remote observation enabled), seen first on a Kubernetes test cluster.

Steps to reproduce

  1. On a cluster of two members, move or rename a few pages on member 1
  2. Look at the logs of member 2

Result

For each renamed page, member 2 logs one ERROR ObservationContextListener - Can't find any begin event corresponding to [org.xwiki.refactoring.event.DocumentRenamedEvent@...]. With DEBUG enabled on org.xwiki.observation.remote, 14 out of 14 DocumentRenamingEvent / DocumentRenamedEvent pairs were handled on two different JGroups receiver threads (0 on the same thread), one begin-event error per pair.

Cause

Remote events are delivered on the JGroups receiver thread pool. ObservationContextListener keeps the begin events in the ExecutionContext of the current thread, and DefaultRemoteObservationManager creates an ExecutionContext for a receiver thread the first time it needs one and never clears it. A begin event handled on thread A and its end event handled on thread B cannot be matched, and the begin event stays in thread A's context, which can later make ObservationContext#isIn answer wrongly for unrelated events handled on that thread.

Proposed fix

Deliver the remote events of one sender in order on a single thread (or with a fresh ExecutionContext per remote event, with the begin/end pairing moved to a per-sender structure), so that the observation context sees the begin and end events of a remote job the same way the local ones are seen.

 
 

2 updates

 
cid:jira-generated-image-avatar-e56c8031-40cc-4131-94e6-ccf035434a7a Changes by Clément Christiaens on 14/Oct/26 18:44
 
Reporter: Claude Clément Christiaens
Assignee: Clément Christiaens