Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-1448

Bean loading/register section not threadsafe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.1.4, 3.0.0-M0
    • core
    • None

    Description

      Issue:

      When two threads (T1,T2) arrive the section {{if (ApplicationContextProvider.getBeanFactory().containsSingleton(ruleClass.getName())) {}}at the same time they will both assume that there is no bean, which is right so far.

      T1 register the bean as it should here ApplicationContextProvider.getBeanFactory().registerSingleton(ruleClass.getName(), rule);. As soon as T2does the same, an exception is thrown.

      Solution:

      When T1 and T2 found that a given bean is not there, they'll hit a synchronized section with double checking. This will prevent the duplicated creation and registration of a bean.

      Attachments

        Issue Links

          Activity

            People

              ilgrosso Francesco Chicchiriccò
              longstone longstone
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m