Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4026

Adapter Factory Race Condition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Adapter 2.1.2
    • None
    • Extensions

    Description

      During initialization of a bundle, it is possible to encounter a race condition in which the BundleTrackerCustomizer::addingBundle(Bundle bundle, BundleEvent event) is triggered after the bundle has begun initialization of a immediate component.

      @Component(immediate = true)
      @Service
      public class ExampleImpl {
      
          @Activate
          public void activate(ComponentContext context) {
              Resource resource = ....
              // Race condition possible here... Could be executed before the BundleTracker (ModelPackageBundleListener)
              SlingModelExample example = resource.adaptTo(SlingModelExample);
          }
      
      }
      

      Attachments

        1. racer.zip
          5 kB
          JBodkin

        Activity

          People

            Unassigned Unassigned
            JBodkin JBodkin
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: