Skip to content

feat(async-config-poll): add BLOCK_BOOT_ON_WATCH to block boot on the config watch#148

Open
Aditya-eddy wants to merge 1 commit into
mainfrom
async-boot-blocking-watch
Open

feat(async-config-poll): add BLOCK_BOOT_ON_WATCH to block boot on the config watch#148
Aditya-eddy wants to merge 1 commit into
mainfrom
async-boot-blocking-watch

Conversation

@Aditya-eddy

Copy link
Copy Markdown
Member

What & why

Adds an env-gated BLOCK_BOOT_ON_WATCH mode to ConfigWatchService so the app can boot-block on the config-watch long-poll — the shape that exposes the async value-epoch fix in keploy.

Today the sample's config watch runs on a background daemon (boot never depends on it), so it can't reproduce the real-world boot deadlock a synchronously-blocking config client hits: at replay the old anchor-hold async engine parks a poll whose delivery is anchored past the reachable test window, and the app never becomes ready.

With BLOCK_BOOT_ON_WATCH=true, init() performs a synchronous GET /v1/buckets/app-config?watch=true and blocks boot until it returns:

  • Old (anchor-hold) engine: the poll is parked → the app never accepts connections → ingress tests fail with connection refused (the deadlock).
  • Value-epoch engine: the startup epoch is served immediately → boot proceeds → tests pass.

When the env is unset (the default / record path, and the existing periodic + httppoll scenarios), the watch keeps running on the background daemon exactly as before — no behavior change.

Pairs with

keploy/keploy#4379 (async value-epoch replay). That PR adds a boot_blocking cell to the async-config-poll e2e which records the app normally and replays it with BLOCK_BOOT_ON_WATCH=true, asserting the app boots and the ingress tests pass — i.e. the value-epoch engine serves the startup epoch instead of parking it. That CI cell needs this env support, so this PR should merge first.

🤖 Generated with Claude Code

… config watch

Env-gated (replay-only) mode: init() does a synchronous GET
/v1/buckets/app-config?watch=true and blocks boot until it returns, the
shape a synchronously-blocking config client hits. Lets the keploy
async-config-poll e2e reproduce the boot deadlock — the old anchor-hold
async engine parks the poll (app never ready) while the value-epoch engine
serves the startup epoch immediately (app boots). When unset (default /
record path, and the periodic + httppoll scenarios) the watch keeps running
on the background daemon, unchanged.

Pairs with keploy/keploy#4379.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Aditya Sharma <aditya282003@gmail.com>
Copilot AI review requested due to automatic review settings July 21, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Aditya-eddy added a commit to keploy/keploy that referenced this pull request Jul 21, 2026
Adds a third async-config-poll cell that records the config watch as a
background poll (as httppoll) but REPLAYS with the app boot-blocking
synchronously on the watch=true poll (BLOCK_BOOT_ON_WATCH). This exercises
the boot-deadlock shape: the value-epoch engine must serve the startup
epoch so the app boots and the ingress tests pass; the old anchor-hold
engine would park the poll and the app would never become ready.

- java-linux.sh: add the boot_blocking scenario (REPLAY_APP_ENV override so
  record and replay can drive the app differently), assert the app's
  boot-watch was served (not parked), and reuse the poll:true/no-pollDurationMs
  record-side check. Also corrects the stale matrix comment.
- java_linux.yml: add boot_blocking to the scenario matrix.

Requires keploy/samples-java#148 (BLOCK_BOOT_ON_WATCH app support) in the
checked-out sample.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Aditya Sharma <aditya282003@gmail.com>
Aditya-eddy added a commit to keploy/keploy that referenced this pull request Jul 21, 2026
…h (temporary)

The boot_blocking async-config-poll cell needs the app's BLOCK_BOOT_ON_WATCH
support (keploy/samples-java#148), which isn't on samples-java's default
branch yet. Pin the async-config-poll job's samples-java checkout to that
branch so the cell is exercised now; repoint to the default branch once #148
merges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Aditya Sharma <aditya282003@gmail.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.

2 participants