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

StorageService shutdown hook should use a volatile variable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.2.7, 3.0.8, 3.8
    • Legacy/Core
    • None
    • Normal

    Description

      In StorageService.java there is a variable accessed from other threads that is not marked volatile.

        private boolean inShutdownHook = false;
        public boolean isInShutdownHook()
         {
             return inShutdownHook;
         }
        drainOnShutdown = new Thread(new WrappedRunnable()
             {
                 @Override
                 public void runMayThrow() throws InterruptedException
                 {
                     inShutdownHook = true;
      

      This is called from at least here:

      ./src/java/org/apache/cassandra/concurrent/DebuggableScheduledThreadPoolExecutor.java:                if (!StorageService.instance.isInShutdownHook())
      

      This could cause issues in controlled shutdown like drain commands.

      Attachments

        Activity

          People

            appodictic Edward Capriolo
            appodictic Edward Capriolo
            Edward Capriolo
            Stefania Alborghetti
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: