Skip to content

fix: harden refresh generation guards#391

Merged
karthiknadig merged 1 commit intomainfrom
fix/issue-390
Apr 5, 2026
Merged

fix: harden refresh generation guards#391
karthiknadig merged 1 commit intomainfrom
fix/issue-390

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

This follow-up fixes the post-merge correctness gap left after #386.

  • make refresh notification emission generation-aware and atomic with the generation check
  • keep stale refresh state from syncing back into shared locators after a newer configure
  • replace the missing-env one-shot boolean with generation-stamped reservation semantics so newer generations can supersede stale reservations
  • add regression tests for stale-generation reporting and missing-env reservation behavior

Fixes #390

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 81ms 349ms 77ms 4ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 67.9%
Base Branch Coverage 67.5%
Delta .4% ✅

Coverage increased! Great work!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 55ms 497ms 46ms 9ms
Full Refresh 99ms 33526ms 92ms 7ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Performance Report (Windows) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 11ms 7ms 2ms 28.6%
Full Refresh 144ms 348ms 111ms 33ms 29.7%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 64.21%
Base Branch Coverage 63.72%
Delta 0.49% ✅

Coverage increased! Great work!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens refresh correctness in PET’s JSONRPC server by making refresh side effects (notifications, shared locator state sync, and missing-env follow-up work) generation-aware so stale work can’t leak across configure boundaries.

Changes:

  • Added a generation-guarded Reporter wrapper to atomically suppress stale refresh notifications after configuration generation advances.
  • Prevented stale refreshes from syncing refresh-state back into the long-lived shared locator graph.
  • Reworked the missing-environment follow-up “one shot” into a generation-stamped reservation so newer generations can supersede stale reservations, and added regression unit tests.
Show a summary per file
File Description
crates/pet/src/jsonrpc.rs Adds generation-aware guards for refresh notifications/state sync and replaces missing-env one-shot tracking with generation-stamped reservation + tests.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@karthiknadig karthiknadig enabled auto-merge (squash) April 5, 2026 01:35
@karthiknadig karthiknadig merged commit d40b4bc into main Apr 5, 2026
34 checks passed
@karthiknadig karthiknadig deleted the fix/issue-390 branch April 5, 2026 01:47
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.

Fix stale refresh generation handling after PR #386

3 participants