Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-1756

DatabaseDescriptor static initialization circular reference when initialized through call to StorageService.instance.initClient

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 0.7.0 rc 1
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      In trunk, attempting to invoke StorageService.instance.initClient results in an NPE due to static definition field ordering in StorageService and a circular reference from DatabaseDescriptor back into an uninitialized field (scheduledTasks). Changing the ordering of the static fields such that scheduledTasks is defined before the static partitioner fixes the issue.

      I've also marked the scheduledTasks executor as final as it doesn't seem to make sense changing it.

      All tests pass with this change locally.

      I suspect this hasn't surfaced in tests as calling initServer first in the same JVM will allow later calls to initClient to see the correctly defined scheduledTasks fields.

      I'm following the recommended way to do this from ClientOnlyExample, if this isn't the right way to initialize things let me know.

        Attachments

          Activity

            People

            • Assignee:
              gdusbabek Gary Dusbabek
              Reporter:
              eonnen Erik Onnen
              Authors:
              Gary Dusbabek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: