Uploaded image for project: 'SonarQube Scanner API'
  1. SonarQube Scanner API
  2. SCANNERAPI-139

Avoid running analysis in forked mode to hang forever

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: API
    • Labels:
      None

      Description

      When running SQ Runner in forked mode, in case there is a bug in SQ batch (which is the case) then process may hang forever waiting for all threads to terminate.
      The fix should be done in BatchLauncherMain:

      public static void main(String[] args) throws IOException {
          new BatchLauncherMain(new BatchLauncher()).execute(args);
      }
      

      should be replaced by something like:

      public static void main(String[] args) {
        try {
          new BatchLauncherMain(new BatchLauncher()).execute(args);
        } catch (Exception e) {
          e.printStackTrace(System.err);
          System.exit(1);
        }
      }
      

      This will allow the forked process to terminate itself in case of exception.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              julien.henry Julien Henry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: