Skip to content

Add '/debug/jobs/list' endpoint that lists all handled jobs

Tomasz Maczukin requested to merge improvement/list-handled-jobs into master

What does this MR do?

Allows Runner's administrator to list currently handled jobs.

Why was this MR needed?

Sometimes (e.g. while doing a graceful shutdown with SIGQUIT) it would be nice to know which jobs are still managed by Runner. It can be deduced from logs, but it's not trivial (requires to look for all received jobs that were not finished).

This MR adds an endpoint for internal metrics server (used also for pprof debugging) that outputs such data:

$ curl -s http://127.0.0.1:6061/debug/jobs/list
id=15009556 url=https://gitlab.com/tmaczukin-test-projects/artifacts-passing-test.git state=running stage=prepare_script executor_stage=docker_run
id=15009554 url=https://gitlab.com/tmaczukin-test-projects/artifacts-passing-test.git state=running stage=upload_artifacts executor_stage=prepare

Are there points in the code the reviewer needs to double check?

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

Merge request reports