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

Deleted execution context issue when forcing feed update thread update from a non-daemonized context

    XMLWordPrintable

Details

    • Unknown

    Description

      The feed plugin update thread "update" method is public and can be called from "outside" the daemonized update thread. This is for example what XWiki Watch use to do in the LoadingStatus page when forced update was requested :

       if (request.force=="1") {
        xwiki.feed.getUpdateThread(request.space).update();
       } else {
      

      (http://fisheye2.atlassian.com/browse/xwiki/watch/trunk/wikis/watch/src/main/resources/WatchCode/LoadingStatus.xml?r=20136)

      This use case has an issue with the current implementation since the update method deletes the current execution context, which is here the request one, not the daemon one (so when later on code relies on it - for example to get the XWikiContext - it throws a NPE).

      The clean solution is to remove the execution context handling from the update method, making the UpdateThread extend AbstractXWikiRunnable ; which itself will handle the EC initialization/deletion

      Attachments

        Activity

          People

            jerome Jerome Velociter
            jerome Jerome Velociter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: