Skip to content

Recover orphaned resources_restart markers - #166

Draft
robjarawan wants to merge 2 commits into
developmentfrom
fix/resource-restart-marker-recovery
Draft

Recover orphaned resources_restart markers#166
robjarawan wants to merge 2 commits into
developmentfrom
fix/resource-restart-marker-recovery

Conversation

@robjarawan

@robjarawan robjarawan commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Fixes #165.

The resources_restart marker only contained a timestamp, so another instance could tell that the marker existed but could not tell whether its owner was still running. If the owner died after creating the marker and before the restarted instance removed it, every later resource restart waited forever and sr3 kept the configuration in the resources_restart state.

So what I did was make marker acquisition exclusive and record the owner PID, process creation time, and timestamp. A contender still waits while that exact owner is alive. If the owner is gone, it verifies that the marker did not change, removes the orphan, and claims a new marker. Timestamp-only markers from the current release get a 60-second compatibility window before they are treated as legacy orphans.

The regression uses the real Resources.restart() path in child processes. One child creates the marker and exits with status 17 at the exec boundary. On the current baseline, the recovery child is still waiting after two seconds. With this fix, it detects the dead owner and reaches its own exec boundary. A separate control keeps the first owner alive and proves that a contender does not take over until the owner finishes.

Before:

2 failed, 2 passed

After:

4 passed

Tests:

  • resource restart regression: 4 passed
  • original audit stale/absent marker fixture: 2 passed
  • focused housekeeping, instance, and manager selection: 4 passed
  • broader suite excluding the unavailable Azure fixture: 358 passed, 1 skipped
  • local maintenance flow: PASS, 5 messages received and downloaded, queues/configurations cleaned up

The existing inherited-descriptor cleanup from MetPX#1652 remains in the same restart path and is unchanged.

This branch also includes the local-fixture CI repair from #140 so the fork maintenance jobs do not depend on public dynamic flows.

Related history: MetPX#1439 and merged MetPX#1553 introduced the coordination marker. I did not find an existing issue for recovery after its owner dies.

@robjarawan
robjarawan force-pushed the fix/resource-restart-marker-recovery branch from ccdef9c to 81d73d6 Compare September 6, 2026 06:30
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Test Results

378 tests   377 ✅  1m 43s ⏱️
  1 suites    1 💤
  1 files      0 ❌

Results for commit 81d73d6.

♻️ This comment has been updated with latest results.

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.

Orphaned resources_restart marker blocks recovery

1 participant