Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-1721

Component Manager Singleton is not thread safe

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Hide

      get several thread that start a ComponentManager.instance()

      => Some times, you will get "null" or "different instances on differents thread"

      Show
      get several thread that start a ComponentManager.instance() => Some times, you will get "null" or "different instances on differents thread"
    • All
    • Small

    Description

      Null pointer exception is due to a frequent singleton code mistake, as you can read here, it use "Synchronisation Locale" Method which is known to have trouble due to compilation "optimization" from JVM.
      We have to use "Technique du Holder" instead.
      POC made with modification on ComponentManager.java work better (with other modification to make ComponentManager more thread safe)

      Attachments

        Activity

          People

            emmanuel_g emmanuel gallois
            clesaec Christophe LeSaec
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: