Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7227

General context isolation issue in the displayers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.2
    • Display, Old Core
    • None
    • Unknown

    Description

      If asked to, the displayers isolate what they need to executed between DocumentAccessBridge#pushDocumentInContext and DocumentAccessBridge#popDocumentFromContext.

      It generally looks like:

      try {
        documentAccessBridge.pushDocumentInContext(backupObjects, documentReference);
        execute stuff related to display
      } finally {
        documentAccessBridge.popDocumentFromContext(backupObjects);
      }
      

      The simple fact that pushDocumentInContext can fail is the issue here: if pushDocumentInContext fail and popDocumentFromContext succeed the current context is lost and pretty much all the following code is broken.

      We need to make sure pushDocumentInContext and popDocumentFromContext are always perfectly in sync (make pushDocumentInContext push a context whatever happen or call popDocumentFromContext only if pushDocumentInContext has been fully done or whatever other idea to make sure it's safe).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: