gitlab runner can't timeout even if the project timeout value set

Summary

Gitlab runner can't timeout exactly as required, even if the project timeout value set

Steps to reproduce

How one can reproduce the issue - this is very important

  1. Set the project timeout value to 10m.
  2. Sleep for 600s, in .gitlab-ci.yml.
  3. Check the system log, and the console output.

Actual behavior

What actually happens

  1. gitlab runner can't send the SIGTERM signal correctly.
  2. The job are still running, even though it's timeout.
  3. When I cancel the job manually, both system log and console are print the following log: "Job failed: execution took longer than 10m0s seconds"

Expected behavior

What you should see instead When the duration reached 10m, it should send the SIGTERM signal to the sub process, and give the feedback to gitlab.

Relevant logs and/or screenshots

Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise. Please paste both build log and Runner's log. LOG:

Jun  6 20:26:03 t-live-qa-14 gitlab-runner[18101]: time="2018-06-06T20:26:03+08:00" level=info msg="Checking for jobs... received" job=4786 repo_url="http://gitlab.bilibili.co/platform/go-common.git" runner=0cfe5d0e
Jun  6 20:43:03 t-live-qa-14 gitlab-runner[18101]: time="2018-06-06T20:43:03+08:00" level=warning msg="Job failed: execution took longer than 10m0s seconds" job=4786 project=23 runner=0cfe5d0e

From the above log, the start time is 20:26:03, the end time is 20:43:03(I canceled the job), duration is 17m, not 10m.

Environment description

Are you using shared Runners on GitLab.com? Or is it a custom installation? Which executors are used? Please also provide the versions of related tools like docker info if you are using the Docker executor. Debian

Used GitLab Runner version

Please run and paste the output of gitlab-runner --version. If you are using a Runner where you don't have access to, please paste at least the first lines the from build log, like:

Version:      10.7.1
Git revision: b9bba623
Git branch:   10-7-stable
GO version:   go1.8.7
Built:        2018-05-02T13:00:31+00:00
OS/Arch:      linux/amd64

企业微信截图_a6043c84-04d0-4925-bea1-192aa4e74a60

Edited Jun 07, 2018 by Ghost User
Assignee Loading
Time tracking Loading