Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-5891

PeriodicCounterUpdater should not rely on static initialisation and destruction order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.9.0
    • Impala 2.11.0
    • Backend
    • None

    Description

      The lifecycle of PeriodicCounterUpdater is weird and depends on static initialisers and destructors running.

      Its constructor spawns a thread and its destructor tests down data structures in some probably unsafe order.

      I've seen a crash in the code which could be caused by the data structures being torn down while the thread is still running:

      Thread 1
       0  libpthread-2.12.so + 0xe2e4
          Found by: given as instruction pointer in context
       1  libpthread-2.12.so + 0x9588
          Found by: stack scanning
       2  impalad!google_breakpad::ExceptionHandler::SignalHandler(int, siginfo*, void*) + 0x23
          Found by: stack scanning
       3  libjvm.so!os::Linux::chained_handler(int, siginfo*, void*) + 0x112
          Found by: call frame info
       4  libjvm.so!JVM_handle_linux_signal + 0xb6
          Found by: call frame info
       5  libjvm.so!signalHandler(int, siginfo*, void*) + 0x43
          Found by: call frame info
       6  libpthread-2.12.so + 0xf790
          Found by: call frame info
       7  impalad!impala::PeriodicCounterUpdater::UpdateLoop() [function_template.hpp : 767 + 0x4]
          Found by: stack scanning
       8  0xffff
          Found by: call frame info
      

      Instead of the static instance object we should just allocate the state on the heap.

      Attachments

        Issue Links

          Activity

            People

              tarmstrong Tim Armstrong
              tarmstrong Tim Armstrong
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: