Skip to content

Fix CI flakiness: restart gateway on wedged reload, retry deployment once - #415

Open
ilijabojanovic wants to merge 1 commit into
masterfrom
fix/ci-reliability-gateway-reload-wedge
Open

Fix CI flakiness: restart gateway on wedged reload, retry deployment once#415
ilijabojanovic wants to merge 1 commit into
masterfrom
fix/ci-reliability-gateway-reload-wedge

Conversation

@ilijabojanovic

Copy link
Copy Markdown
Member

Summary

  • Traced the recurring CI failures on federation, plugin-python-grpc, analytics-splunk (and occasionally others) to a single root cause: a transient network error during a gateway reload's Dashboard policy fetch can wedge the gateway's reload processor entirely, since it only processes one reload at a time. Every reload queued behind it — including the periodic resends added in Fix/wait for api loaded retry budget #412 — gets accepted but never actually runs, so wait_for_api_loaded's retry budget always runs out.
  • wait_for_api_loaded (scripts/common.sh) now restarts the tyk-gateway container once if resending reloads hasn't cleared things after ~40s, then gives it one more fresh retry budget before failing for real.
  • The "Create deployment" step in tyk-demo-tests.yml now wraps up.sh with one down.sh + up.sh retry, to absorb transient bootstrap failures unrelated to the code under test.

Investigation details

Confirmed via gateway container logs from a failed run: "Network error detected, attempting to re-register node..." context="policy fetch" fires mid-reload, and no reload: complete is ever logged again for the rest of the job. Subsequent group-reload requests (including the #412 resends) log "Group reload accepted" but never actually execute, because they're queued behind the wedged one.

Test plan

  • Confirm bash -n scripts/common.sh passes (done locally)
  • Trigger Tyk Demo Tests workflow via workflow_dispatch on this branch and confirm federation / plugin-python-grpc / analytics-splunk pass
  • Watch a few subsequent scheduled/push runs on master after merge to confirm the flake rate drops

🤖 Generated with Claude Code

Traced repeated CI failures (federation, plugin-python-grpc,
analytics-splunk, ...) to the same root cause: a transient network
error during a gateway reload's Dashboard policy fetch can wedge the
gateway's reload processor entirely, since it only processes one
reload at a time. Every reload queued behind it - including the
periodic resends added in #412 - gets accepted but never actually
runs, so wait_for_api_loaded's retry budget always runs out.

wait_for_api_loaded now restarts the tyk-gateway container once if
resending reloads doesn't clear things after 40s, then gives it one
more fresh retry budget before failing for real.

Also wrap deployment creation in the test workflow with one
down.sh + up.sh retry, to absorb transient bootstrap failures
unrelated to the code under test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant