Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4074

Race condition in LazyValueGetter

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.12.0
    • Component/s: None
    • Labels:

      Description

      There is a race condition between acquiring the lock and the values map being initialized here.

      @Override
        public ImmutableBytesWritable getLatestValue(ColumnReference ref) throws IOException {
          // ensure we have a backing map
          if (values == null) {
            synchronized (this) {
              values = Collections.synchronizedMap(new HashMap<ColumnReference, ImmutableBytesWritable>());
            }
          }
      

        Attachments

        1. PHOENIX-4074.patch
          1 kB
          Samarth Jain
        2. PHOENIX-4074_v2.patch
          5 kB
          James R. Taylor

          Activity

            People

            • Assignee:
              samarthjain Samarth Jain
              Reporter:
              samarthjain Samarth Jain
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: