Fall back to direct polling when the Job Router is disabled

What does this MR do?

Fall back to direct polling when the Job Router is disabled

On an Unimplemented response from GetJob, drop the cached router discovery and request the job directly, instead of waiting for the discovery cache to expire.

Why was this MR needed?

Disabling the job_router Rails feature flag stops the discovery endpoint from returning a KAS URL. Runners revert to direct Rails polling on their next discovery refresh, bounded by the 1-hour discoveryTTL cache. There is no mechanism for immediate rollback today.

We need to cut rollback propagation from up to 1 hour down to seconds.

What's the best way to test this MR?

  1. Enable feature flag in Rails - Feature.enable(:job_router)
  2. Start a runner with the following confing.
      [runners.feature_flags]
        FF_USE_JOB_ROUTER = true
  3. Disable feature flag in Rails - Feature.disable(:job_router)
  4. Observe log in GitLab Runner - Job router is disabled, falling back to direct job requests

What are the relevant issue numbers?

Edited by Vishal Tak

Merge request reports

Loading