Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6736

Java 9: rework GridCacheMapEntry synchronization logic to avoid Unsafe.monitor* methods

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • cache
    • None

    Description

      GridCacheMapEntry class rely on synchronized on itself heavily. In ATOMIC caches we lock multiple entries at once using Unsafe.monitorEnter/Exit methods. Unfortunately these methods were removed in Java 9. Recursion is not an option, as it would cause stack overflow for putAll operations with multiple entries.

      Possible fixes:
      1) Rework synchronized to ReentrantLock. Easy, but may cause additional memory pressure.
      2) Have different implementations for Java 8 (synchronzied) and Java 9 (ReentrantLock) - much more complex solution, because we will require separate module for Java 8 and Java 9.
      3) Rework ATOMIC caches, so that putAll operation updates entries one-by-one. As a side effect it will eliminate deadlocks.

      Attachments

        Issue Links

          Activity

            People

              andrey-kuznetsov Andrey Kuznetsov
              vozerov Vladimir Ozerov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: