Skip to content

Retry user config lookup on missing subject - #53

Closed
lucarlig wants to merge 1 commit into
mainfrom
user/luca/retry-user-config-miss
Closed

Retry user config lookup on missing subject#53
lucarlig wants to merge 1 commit into
mainfrom
user/luca/retry-user-config-miss

Conversation

@lucarlig

@lucarlig lucarlig commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Brand-new subjects can reach the dataplane before the control-plane publisher has written UserConfig:<subject> into Redis. The request currently fails immediately with a bare 400 Bad Request and Problem occurred retrieving the configuration, which hides the publisher-latency race from the client.

This showed up in live-rbac when fixtures created users and servers, then exercised them within seconds: existing-subject cache staleness is handled by the user-config cache fix, but first-publish misses for brand-new subjects still need a bounded on-miss retry.

Approach

  • Retry NoDataForKey user-config lookups before rejecting the request.
  • Keep the retry bounded: 30 attempts at 100ms each, for about 3 seconds max.
  • Return 403 Forbidden with No dataplane config for subject if the subject still has no config after retries.
  • Cover retry success and retry exhaustion in middleware tests.

Validation

  • cargo test -p contextforge-gateway-rs-lib user_config_store::tests
  • cargo test -p contextforge-gateway-rs-lib -- --test-threads=1
  • cargo fmt --check
  • cargo clippy -p contextforge-gateway-rs-lib --all-targets -- -D warnings

Signed-off-by: lucarlig <luca.carlig@ibm.com>
@lucarlig
lucarlig force-pushed the user/luca/retry-user-config-miss branch from c731171 to e60c000 Compare July 2, 2026 15:05
@lucarlig

lucarlig commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

this is not an issue, we will modify the test instead to give time for control-plane to catch up

@lucarlig lucarlig closed this Jul 2, 2026
@lucarlig lucarlig self-assigned this Jul 6, 2026
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