Hanging Job Never timesout
Summary
If one of the tasks in a job is hanging for whatever reason, it will not timeout
Steps to reproduce
Create a Job with command that hangs, like sleep that is longer than timeout for the whole job and run it.
Example Project
Just create a job with sleep longer than the timeout, surprisingly it is going to run through the whole sleep exceeding the timeout.
What is the current bug behavior?
It seems as if the timeout is getting checked between script commands only, therefore the timeout never happens if a command hangs/takes longer than job timeout.
What is the expected correct behavior?
Gitlab-runner should timeout once the job exceeded the maximum-timeout, regardless on whether a command is still running. Whatever is still running should be killed(even forcefully if required) and resource should be release for the next job.
Relevant logs and/or screenshots
No logs are shown while this is happening.
Output of checks
No output, you'll see the tim ethe job is running is longer than the timeout/max time below it.
Results of GitLab environment info
Expand for output related to GitLab environment info
We use gitlab.com service with the latest version of gitlab-runner, so nothing proprietary. In my test, I did make use of the virtualbox runner - if that makes a difference(though it shouldn't)
Results of GitLab application Check
Expand for output related to the GitLab application check
N/A
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)