Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
borderColor#888888#C3CCD7
bgColor#FCFCFC

Table of Contents
indent16px


A 다음은 백그라운드 태스크(Background Task can be:

  • the import of an Analysis Report
  • the execution of the computation of Views

Analysis Reports

Note

Note that analysis is not complete until the relevant Background Task has been completed. Even though the SonarQube Scanner's log shows EXECUTION SUCCESS, the analysis results will not be visible in the SonarQube project until after the Background Task has been completed.

After a SonarQube Scanner has finished analyzing your code, the result of the analysis (Sources, Issues, Metrics) -  the Analysis Report - is sent to SonarQube Server for final processing by the Compute Engine. 

Those Analysis Reports are queued and processed serially. You can control the number of Analysis Reports that can be processed at a time in $SQ_HOME/conf/sonar.properties (see sonar.ce.workerCount - Default is 1).

Administrators can view the current queue at Administration > Projects > Background Tasks.

Image Removed

Filters

You can filter Background Tasks according to their Status: Pending, Success, Failed or Canceled

The "Only Latest Analysis" button will filter the Background Tasks by showing only the last import for each project.

You can also filter Background Tasks according to the starting date of import.

At the top of the page, are there are two to three counters:

  • pending - shows the number of Analysis Reports queued and waiting to be processed.
  • failures shows the number of projects where the processing of a project's most recent analysis report failed.
  • the third counter is only present during the processing of an analysis report. It shows the duration-to-date of the task currently being processed.

At the Project level, when there is a pending Analysis Report waiting to be consumed, you have a "Pending" notification in the header.

Image Removed

The Background Task being processing is marked with a rolling "wait" icon:

Image Removed

Cancel Import

You can cancel the handling of a task by clicking :

  • on the red 'x' available on each line of a pending task
  • on the red "bulk cancel" option next to the pending jobs count. This button cancels all pending tasks.

Image Removed

Logs

For each Analysis Report you have a dropdown menu allowing you to access to the "Scanner Context" showing you the configuration of the Scanner at the moment when the code scan has been run.

In case of failure, you will have another option available on this dropdown menu : "Show Error Details", to get the technical details why the processing of the Background Task failed.

Image Removed

Other Tasks

The Background Tasks page allows you also to follow other task executions such as, for example, Views Computation triggered by the Governance Plugin)가 될 수 있습니다:

  • 분석 보고서(Analysis Report) 임포트
  • 포트폴리오(Portfolios) 연산 실행
  • 프로젝트 Import/Export 실행

스캐너가 분석을 종료한 후 일어나는 일들

분석 작업은 관련된 Background Task가 종료된 이후 완료됩니다. SonarQube Scanner의 로그에 EXECUTION SUCCESS가 표시되더라도, 분석 결과는 Background Task가 종료된 이후 SonarQube UI에 표시됩니다. SonarQube Scanner가 코드 분석을 완료한 뒤, 분석 결과(소스 코드, 이슈 및 각종 지표 등) --분석 보고서--가 SonarQube 서버로 전달되고, 이후 Compute Engine이 최종 처리를 수행합니다. 

프로젝트 레벨에서 처리 대기 중인 분석 보고서가 존재하는 경우, 프로젝트 화면 상단에 "대기 중(Pending)" 문구가 표시됩니다:

Image Added

시스템 관리자는 Administration > Projects > Background Tasks 메, 프로젝트 관리자는 Administration > Background Tasks 메뉴를 통해 현재 대기열의 분석 보고서를 확인할 수 있습니다:

Image Added

Background Task가 성공적으로 처리되면, 움직이는 "wait" 아이콘이 리스트에 표시됩니다.

분석 보고서 처리 실패 확인하기

일반적인 경우 Backgound Tasks들은 대부분 성공하지만, 일부 예상치 못한 환경의 경우 처리에 실패할 수 있습니다:

  • 대규모의 프로젝트 분석 보고서를 처리하는 도중 메모리 부족 상황 발생시
  • 하나의 보고서에서 기 존재하는 모듈이나 프로젝트 사이의 키 값 충돌 시
  • ...

처리 실패 상태는 프로젝트 홈페이지에 표시되나, 이는 사용자가 직접 확인을 해야하는 번거로움이 있습니다. Background task가 실패하는 경우 이메일 알림을 받을 수 있습니다. 개인 프로파일의 Notifications 섹션에서 알림 설정을 수행할 수 있습니다.

실패한 백그라운드 태스크 분석하기

분석 보고서의 드롭 다운 메뉴를 사용해 "Scanner Context"에 접속할 수 있습니다. 이 페이지는 코드 스캐닝 수행 시점의 Scanner 환경 설정 정보를 표시합니다.

분석이 실패하는 경우, 해당 드롭다운 메뉴의 "Show Error Details"를 클릭해 Background Task 처리 실패와 관련된 기술적인 세부 내용을 확인할 수 있습니다.

Image Added

대기 중인 분석 리포트 취소하기

다음의 방법으로 태스크 처리를 취소할 수 있습니다:

  • 대기 중 상태인 태스크 목록의 'x; 버튼을 클릭합니다. 해당 태스크의 처리를 취소합니다.
  • 대기 중 상태인 태스크 목록의 'bulk cancel'을 클릭합니다. 대기 중 상태인 모든 태스크의 처리를 취소합니다.

Image Added

백그라운드 태스크 탐색하기

필터

Backgound Tasks를 Pending, Success, Failed 및 Canceled 기준에 따라 필터링할 수 있습니다.

"Only Latest Analysis" 버튼을 클릭하면, 각 프로젝트의 가장 최근 분석 리포트만을 표시합니다.

페이지 상단에는 2개 혹은 3개의 카운터를 표시합니다:

  • pending - 대기열에서 처리 대기중인 분석 보고서의 수를 표시합니다.
  • failures - 가장 최근 분석 보고서 처리에 실패한 프로젝트의 수를 표시합니다
  • duration-to-date of the task - 분석 보고서를 처리하는 동안 소요된 시간을 표시합니다.