Uploaded image for project: 'MediaPortal 2'
  1. MediaPortal 2
  2. MP2-870

PluginManager can return null when instantiating plugin object due to race condition

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.4
    • 2.3.2
    • Plugin Manager
    • None

    Description

      <p>There are occassional errors in logs (e.g.&nbsp;<a href="https://forum.team-mediaportal.com/threads/crash-when-closing-down-from-top-left-icon.140388/post-1283062">here</a>) of a failure to build a plugin item. The trigger is when multiple threads try and request the same plugin item&nbsp;at similar&nbsp;times, notably multiple MediaItemLists request MediaItemFilters at a similar time. The underlying cause is that the PluginRuntime caches an ObjectReference <a href="https://github.com/MediaPortal/MediaPortal-2/blob/292cffa3ecea25d6725cc719c1cd20d219f1d887/MediaPortal/Source/Core/MediaPortal.Common/PluginManager/PluginRuntime.cs#L233">here</a>, before it's object has been assigned <a href="https://github.com/MediaPortal/MediaPortal-2/blob/292cffa3ecea25d6725cc719c1cd20d219f1d887/MediaPortal/Source/Core/MediaPortal.Common/PluginManager/PluginRuntime.cs#L241">here</a>, then a subsequent thread returns the cached ObjectReference without an object.</p>

      Attachments

        Activity

          People

            brownard Brownard
            brownard Brownard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: