Skip to content

More aggressive agent info polling

Mikhail Mazurskiy requested to merge ash2k/fix-backoff into master

Relates to #386 (closed).

This is probably the biggest offender I found while investigating the above issue! CI tunnel routing timeout is 20seconds. If GitLab returns an error for agent info call (which it occasionally does), the code currently sleeps for 10 * time.Second! If GitLab returns an error again, code is going to sleep for 20 seconds and, after that request is aborted.

The problem is that if there are multiple reverse tunnel requests, that all block on a single get agent info call (via cache, to avoid asking GitLab for the same info more than once). So, the request pile on the cache, GitLab returns an error, ALL requests are blocked for 10 seconds. Then, if GitLab errors once more, it's game over.

Merge request reports