Repository navigation
Resume pets after a killed server when no deletion was lost - #44
Merged
Merged
Conversation
A server killed mid-shutdown left pets-recovery-required behind, and every later start disabled CompanionPets until an operator removed it by hand. The session now also arms pets-session-intact, which is withdrawn as soon as a death or release cannot reach pet-deletions.log, a migration is held, or the shutdown save fails. When both files are found at startup, every terminal transition is already in the log, so the store logs a warning and resumes from the last saved pets.yml. A guard without the proof, including one left by an older release, still requires reconciliation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On 15 October at 01:25 UTC, TF Main was stopped and the process was killed about six seconds later, before CompanionPets reached
onDisable. Thepets-recovery-requiredguard stayed on disk. Every later start (01:25, 06:10 and 06:10 the next day) then loggedPrevious pet session did not commit a clean shutdownand disabled the plugin, so pets were unavailable until an operator removed the file by hand.The guard exists for one case: a pet death or release that could not be written to
pet-deletions.log. A stalepets.ymlcould then bring that pet back. A killed process with healthy storage cannot leave that state, becauseremove()writes and forces the log entry before the body goes away, andread()drops logged IDs from the saved data.Change
beginSession()writespets-session-intactbefore it creates the guard.pets.ymlwith the deletion log applied.Changes saved within the five-second flush window before a kill can still be lost, as with any crash. Deaths and releases cannot.
Tests
pets.ymlstill listed; a legacy guard still blocks; a stale proof is discarded; plugin-level startup after a kill.mainalso fails 64 of them.🤖 Generated with Claude Code