Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13418

ZkStateReader.PropsWatcher synchronizes on a string value & doesn't track zk version

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.0, master (9.0)
    • Fix Version/s: 8.1, master (9.0)
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      While contemplating adding better caching to collection properties to avoid repeated calls to ZK from code that wishes to consult collection properties, I noticed that the existing PropsWatcher class is synchronizing on a string value for the name of a collection. Synchronizing on strings is bad practice, given that you never know if the string might have been interned, and therefore someone else might also synchronizing on the same object without your knowledge creating contention or even deadlocks. Also this code doesn't seem to be doing anything to check ZK version information, so it seems possible that out of order processing by threads could wind up caching out of date data. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gus Gus Heck
                Reporter:
                gus Gus Heck
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: