Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-13037

Stacktrace should always be available in logs

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.3
    • Component/s: Component Viewer, Web
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      WHY

      By default, and since Java 1.5, a JVM optimisation can hide stacktrace of frequently raised errors.

      From release notes JDK 5.0  :

      The compiler in the server VM now provides correct stack backtraces for all "cold" built-in exceptions. For performance purposes, when such an exception is thrown a few times, the method may be recompiled. After recompilation, the compiler may choose a faster tactic using preallocated exceptions that do not provide a stack trace. To disable completely the use of preallocated exceptions, use this new flag: -XX:-OmitStackTraceInFastThrow.

      Since Exception are not used for control flow in SonarQube and are therefore very rare (target is there should never be any), this JVM optimization is not bringing any performance benefit to SonarQube.

      On the contrary, it's bringing complexity in investigating issues faces by users/customers and their logs don't date back enough to get the original stacktrace of an error and the JVM optimization has since kicked in and no stacktrace is available anymore (eg. SUPPORT-16935).

      This optimisation should be disabled in SonarQube.

      WHAT

      JVM option to disable this optimisation (-XX:-OmitStackTraceInFastThrow) should be added to the options of the Web and CE processes in SonarQube.

      Note that this option is also put (and non removable) in ElasticSearch.

      HOW

      Add the option to WebJvmOptions#mandatoryOptions and CeJvmOptions#mandatoryOptions.

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: