Add standby compression start delay#184
Conversation
✱ Stainless preview buildsThis PR will update the ✅ hypeman-go studio · code
✅ hypeman-typescript studio · code
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
…sion-delay # Conflicts: # cmd/api/api/instances_test.go # lib/instances/create.go # lib/instances/types.go # lib/oapi/oapi.go
|
waiting until data or use case justified |
|
I'll monitor this standby compression delay feature for Hypeman. The change adds timing parameters for delaying compression after standby, with persistence across server restarts. Key things I'll watch:
The new metrics ( |
hiroTamada
left a comment
There was a problem hiding this comment.
Reviewed incrementally - looks good overall.
Summary:
- Clean implementation of delayed standby compression
- Well-designed crash recovery via persisted
PendingStandbyCompression - Good distinction between preemption (running) vs skipped (pending)
- Comprehensive metrics and test coverage
Minor notes:
- Left one nit on
execCommandWithRetryre: potential shared test util - iptables
-wflag change is unrelated but reasonable to bundle
Ship it!
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ecaa47f. Configure here.

Summary
POST /instances/{id}/standbyand a per-instance default insnapshot_policyTesting
go test ./lib/instancesgo test ./cmd/api/api -run 'Test(CreateInstance_MapsStandbyCompressionDelayInSnapshotPolicy|CreateInstance_InvalidStandbyCompressionDelayInSnapshotPolicy|InstanceToOAPI_EmitsStandbyCompressionDelayInSnapshotPolicy|StandbyInstance_MapsCompressionDelay|StandbyInstance_InvalidCompressionDelay|StandbyInstance_InvalidRequest)$'Notes
go test ./cmd/api/apistill hits unrelated environment-dependent volume tests on this machine becausemkfs.ext4is not available in$PATH.Note
Medium Risk
Medium risk because it changes standby/snapshot compression job orchestration, persistence, cancellation semantics, and adds startup recovery behavior that could affect restore/delete/snapshot flows and background job accounting.
Overview
Adds a standby-only snapshot compression delay configurable per request (
POST /instances/{id}/standbycompression_delay) and as an instance default (snapshot_policy.standby_compression_delay), including API parsing/validation and OAPI spec updates.Refactors snapshot compression jobs to support a pending-delay state: delayed jobs wait on a timer, can be canceled and recorded as skipped (distinct from canceling an active compression), and persist a
PendingStandbyCompressionplan in instance metadata so delayed jobs are recovered on manager startup.Updates restore/snapshot/delete/fork paths to clear pending plans and avoid copying them into derived metadata, adds new compression wait/active vs pending metrics and traces, and hardens/flakes fixes in integration/network tests (iptables
-w, guest exec retry).Reviewed by Cursor Bugbot for commit af8e7e3. Bugbot is set up for automated code reviews on this repo. Configure here.