Terminate requests on process shutdown
What does this MR do?
Handles open HTTP requests for new jobs termination at the process shutdown event.
Why was this MR needed?
The main Runner's loop is locking on making a GitLab HTTP requests for new jobs. As GitLab is using a "long polling" to limit the load generated by Runner requests, the shutdown operation is usually blocked for a while on those requests.
This MR adds a context that is passed to these requests and that is terminated at the process shutdown event. With this the requests awaiting GitLab's response are interrupted immediately and Runner is able to proceed with it's own termination.
Are there points in the code the reviewer needs to double check?
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Added tests for this feature/bug -
In case of conflicts with master
- branch was rebased
What are the relevant issue numbers?
Closes #4173 (closed)
Related to #4917 (closed)
Edited by Tomasz Maczukin